I have created a new table in my SQL Server 2008 database.
I want to get an entity based on a unique constraint
I have followed this http://msdn.microsoft.com/en-us/library/ms190024.aspx
To create a unique constraint
- In Object Explorer, right-click the table to which you want to add a unique constraint, and click Design. The table opens in Table Designer.
2.From the Table Designer menu, click Indexes/Keys.
3.In the Indexes/Keys dialog box, click Add.
- In the grid, click Type and choose Unique Key from the drop-down list box to the right of the property.
I have looked in the Indexes folder and have this index
UNIQUE NONCLUSTERED INDEX [IDX_SystemFileKey] ON [Global].[SystemFile]
All looks sweet.
I refresh the catalogue for my LLBLGen Pro project, added in my new table and ran generate.
Where can one see in the output of the generator that support for the unique constraint exists?
I rebuilt the two llblgen pro projects and then tried to use the unqiue constraint
public MainDictionary(string connectionString)
{
connection_String = connectionString;
using (var adaptor = new DataAccessAdapter(connectionString))
{
try
{
connection_String = connectionString;
SystemFileEntity MainDictionary = new SystemFileEntity();
MainDictionary.SystemFileKey = MainDictionaryKey;
adaptor.FetchEntityUsingUniqueConstraint(MainDictionary, MainDictionary.ConstructFilterForUCSystemFileKey());
}
catch (Exception e)
{
throw new Exception("Cannot acquire main system dictionary",e);
}
}
}
There is no ConstructFilterForUCSystemFileKey() for the MainDictionary entity