The application wizard creates a sample model project based on the IdeaBlade tutorial database, but place in a namespace you specify (default is <company>.<app>.Model. This project also contains some common files that need to be present in any Cabana model. Our intention is that you would remove the tutorial-specific entities from this project and replace them with your own data model. This is a little tricky but here are some beginning steps:
- In your application solution, start the IdeaBlade object mapper. Verify that it connects properly to the tutorial database.
- Select all a classes EXCEPT BaseEntity and User.
- Click delete (the red minus button) and confirm.
- Save the model and exit the object mapper
- In the Model project:
- Delete or exclude TitleOfCourtesy.cs.
- Delete or exclude AuditArgs.cs, AuditConfig.cs, and AuditConfigService.cs (in the Common folder)
- Edit MainPm.cs and delete these two lines in the Initialize() method:
msManager.DefaultSaveOptions.ExcludeFromPostSaveRefetch =
new List<Type>(new Type[] { typeof(AuditValue) });
- Edit Source\Foundation\Services\ListConverterService.cs:
- In the method CreateServiceItemCore() comment or remove all cases except default.
- Comment or remove all five regions below this method.
- Again start the object mapper.
- Change the data source to point to your application database.
- Add classes to map to your database tables, adjust properties as necessary. Be sure to map your “User” table that will be used to authenticate or authorize users.
- Save the model and exit the object mapper.
- In your model project, Edit your “User” entity:
- Provide an object (might be the “User” entity itself) that implements IUser.
- Provide static methods GetUserByCredential() and GetUserByUserLogin() that return an instance of your IUser object. The SecurityUser.cs file from the sample model (still around but excluded from the project) provides an example.
- In your model project, edit LoginManager.cs:
- In the two methods GetUserPasswordIdentity and GetWindowsIdentity(), invoke the appropriate GetUserBy… methods on your “User” entity.
These steps may not be complete, but this should get you pretty close to being able to build and run with your model. Obviously, we have some restructuring work to do in the next version of Cabana.
I’ll be happy to help you through this process.
Hope this helps.
BIll Jensen
IdeaBlade