ova.NetCore.General.EntityFramework.Light

This solution assigned for easy development of any application by ASP NetCore EntityFramework in one-context SQL infrastructure. See GitHub.


Keywords
entity, entityframework, sql, dbcontext, configuration, appconfig, entityconfig
License
Other
Install
Install-Package ova.NetCore.General.EntityFramework.Light -Version 1.1.0.2

Documentation

EntityFramework

This solution is designed for easy development of any application by ASP NetCore EntityFramework in one-context SQL infrastructure.


  1. The solution implements abstraction, infrastructure, configuration and initial levels.
  2. Contents: principal EF interfaces (IEntity and INavigation), abstract (mustinherit) class EntityConfig, two classes AppConfigBuilder and SqlDbContext;
  3. The initial level is based on json-files.
  4. The product provides components for implementing models, configurating models, configurating applications by applying the file appsetings.json;

5

Does:
building schema of model from Entity Configuration Files; initializing (if necessary) from individual json-files.

ToDo: install this NugetPackage to application; to implement entities of model by IEntity and INavigation in application; to inherit EntityNameConfig files from EntityConfig; inherit from SqlDbContext if necessary (can be used directly); create instances of entities is NOT necessary, they will be created automatically. Be careful: instances will be created for all configuration files implementing IEntityConfiguration for ALL project assemblies; add global configurations variable to module Program of application, i.e.: public IConfigurationRoot AppConfig (for VB - Public AppConfig As IConfigurationRoot); add configuration to sub Main of Program: var new AppConfigBuilder appconfigbuilder; AppConfig = appconfigbuilder.Build (for VB - Dim appconfibuilder As New AppConfigBuilder : AppConfig = appconfigbuilder.Build). You can to set new settings filename fo appropriate parameter of constructor AppConfigBuilder. But this NOT recommended strongly, filename by default is "appsettings.json"; define ConnectionString in appsettings.json; replace appsettings.json to BaseDirectory of application; for initializing model you can to replace apropriate initials files to BaseDirectory/initials. Filenames must be strongly appropriate entitynames, i.e. Category.json for entity Category; to using database, i.e. Using db = new SqlDbContext(AppConfig,"yourconnectionstringname")