fmwviormv / sqlite-net

Automatically exported from code.google.com/p/sqlite-net
0 stars 0 forks source link

Allow multiple indices on a single property #43

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Apply multiple Indexed or Unique attributes on a single property.
2. Compile.

What is the expected output? What do you see instead?

Expect to have a single property referenced in multiple indices.

Instead, get "error CS0579: Duplicate 'Unique' attribute" or similar.

What version of the product are you using? On what operating system?

sqlite-net 1.0.5, Windows (VisualStudio 2010 SP1)

Please provide any additional information below.

This has a simple fix. Change the attribute decoration on IndexedAttribute and 
UniqueAttribute in SQLite.cs from:
  [AttributeUsage (AttributeTargets.Property)]
to
  [AttributeUsage(AttributeTargets.Property, AllowMultiple = true)]

It seems the rest SQLite.cs handles properties with multiple indices properly.

Original issue reported on code.google.com by mhey...@gmail.com on 29 Aug 2012 at 11:20