This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| nebollogger.entityframework [2021/08/02 17:44] – nebol | nebollogger.entityframework [2021/08/07 02:10] (current) – nebol | ||
|---|---|---|---|
| Line 24: | Line 24: | ||
| </ | </ | ||
| + | < | ||
| + | using Microsoft.EntityFrameworkCore; | ||
| + | using NebolLogger; | ||
| + | using NebolLogger.Destinations.Database; | ||
| + | using NebolLogger.EntityFramework; | ||
| + | using NebolLogger.Filters; | ||
| + | </ | ||
| < | < | ||
| Line 50: | Line 57: | ||
| < | < | ||
| Install-Package Microsoft.EntityFramework | Install-Package Microsoft.EntityFramework | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | using NebolLogger; | ||
| + | using NebolLogger.Destinations.Database; | ||
| + | using NebolLogger.EntityFramework; | ||
| + | using NebolLogger.Filters; | ||
| </ | </ | ||
| Line 61: | Line 75: | ||
| Logger.Instance.Destinations.Add(db_dest); | Logger.Instance.Destinations.Add(db_dest); | ||
| } | } | ||
| + | </ | ||
| + | |||
| + | === Another possible option for DB creation: Using Microsoft.EntityFramework.Tools === | ||
| + | |||
| + | To prepare database, run in Package Manager: | ||
| + | |||
| + | < | ||
| + | update-database -ConfigurationTypeName NebolLogger.EntityFramework.NebolLoggerDbContextConfiguration -Verbose | ||
| + | </ | ||
| + | |||
| + | or if you're using MySQL: | ||
| + | |||
| + | < | ||
| + | update-database -ConfigurationTypeName NebolLogger.EntityFramework.NebolLoggerDbContextConfiguration_MySQL -Verbose | ||
| </ | </ | ||