Exemplo n.º 1
0
 public async Task <TEntity> FindObject <TEntity>(string name, BPLoggerContext context) where TEntity : class, INameId
 {
     if (context.Set <TEntity>().Any(y => y.Name.ToLower().Contains(name.ToLower())))
     {
         return(await context.Set <TEntity>().FirstOrDefaultAsync(y => y.Name.ToLower().Contains(name.ToLower())));
     }
     else
     {
         var entity = Activator.CreateInstance <TEntity>();
         entity.Name = name;
         return(entity);
     }
 }
Exemplo n.º 2
0
 public async Task CreateLogAsync(Log log, BPLoggerContext context)
 {
     // this is going to create the log in the system
     context.Logs.Add(log);
     await context.SaveChangesAsync();
 }
Exemplo n.º 3
0
 public CoreLoggerProvider()
 {
     _context = new BPLoggerContext();
     _service = new CoreLoggerServices();
 }