-
Notifications
You must be signed in to change notification settings - Fork 1
Project Initialization
Orbis Alonzo Gutierrez edited this page Aug 23, 2023
·
1 revision
To initialize the project, there are 2 things to consider. First, if you're going to implement the BaseRepository or the MapRepository.
- If you're going to use the
BaseRepositorywithoutIdentityor any helper,extensions etc. congratulations, you don't need to configure anything. - If you're going to use the
BaseRepositorywithIdentity.
// - User - IdentityUser
// - ApplicationIdentityDbContext - FoundationKitIdentityDbContext
builder.Services.AddFoundationKitIdentity<User, ApplicationIdentityDbContext>();- If you want to use
MapRepositoryyou need to add this code toprogram.csfile:
//this configuration is necessary if you want use IMapRepository with IdentityDbContext
// - Assembly.GetExecutingAssembly() - Assembly for AutoMapper profiles
// - User - IdentityUser
// - ApplicationIdentityDbContext - FoundationKitIdentityDbContext
builder.Services.AddFoundationKitIdentityWithMapper<User, ApplicationIdentityDbContext>(Assembly.GetExecutingAssembly());
//this configuration is necessary if you want use IMapRepository without IdentityDbContext
builder.Services.AddFoundationKit(Assembly.GetExecutingAssembly());Finish you're ready for usage the library.