User Tools

Site Tools


nebollogger.entityframework

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
nebollogger.entityframework [2021/08/02 17:43] nebolnebollogger.entityframework [2021/08/07 02:10] (current) nebol
Line 4: Line 4:
  
 See the nuget page  at https://nuget.nebol.se for version history etc. See the nuget page  at https://nuget.nebol.se for version history etc.
- 
-Despite the name it only supports (currently as of 1.0.0.12) .NET Standard 2.1 and .NET Core 3.0 and 3.1 
  
 It creates and uses a couple of tables: It creates and uses a couple of tables:
Line 26: Line 24:
 </code> </code>
  
 +<code>
 +using Microsoft.EntityFrameworkCore;
 +using NebolLogger;
 +using NebolLogger.Destinations.Database;
 +using NebolLogger.EntityFramework;
 +using NebolLogger.Filters;
 +</code>
  
 <code> <code>
Line 44: Line 49:
 </code> </code>
  
-=== Initialization in .NET Standard / .NET Core for MS SQL Server ===+=== Initialization in .NET Framework for MS SQL Server ===
  
 Create the empty database.  Create the empty database. 
Line 52: Line 57:
 <code> <code>
 Install-Package Microsoft.EntityFramework Install-Package Microsoft.EntityFramework
 +</code>
 +
 +<code>
 +using NebolLogger;
 +using NebolLogger.Destinations.Database;
 +using NebolLogger.EntityFramework;
 +using NebolLogger.Filters;
 </code> </code>
  
Line 63: Line 75:
  Logger.Instance.Destinations.Add(db_dest);  Logger.Instance.Destinations.Add(db_dest);
 } }
 +</code>
 +
 +=== Another possible option for DB creation: Using Microsoft.EntityFramework.Tools ===
 +
 +To prepare database, run in Package Manager:
 +
 +<code>
 +update-database -ConfigurationTypeName NebolLogger.EntityFramework.NebolLoggerDbContextConfiguration -Verbose
 +</code>
 +
 +or if you're using MySQL:
 +
 +<code>
 +update-database -ConfigurationTypeName NebolLogger.EntityFramework.NebolLoggerDbContextConfiguration_MySQL -Verbose
 </code> </code>
  
nebollogger.entityframework.1627919018.txt.gz · Last modified: 2021/08/02 17:43 by nebol