public virtual async Task <T> CreateAsync <T>(T entity) where T : class, new()
        {
            await _senderDbContext.Set <T>().AddAsync(entity);

            await _senderDbContext.SaveChangesAsync(true);

            return(entity);
        }
Пример #2
0
 //update
 public virtual async Task Update(SubscriberDeliveryTypeSettingsLong item)
 {
     using (SenderDbContext context = _dbContextFactory.GetDbContext())
     {
         context.SubscriberDeliveryTypeSettings.Attach(item);
         context.Entry(item).State = EntityState.Modified;
         int changes = await context.SaveChangesAsync().ConfigureAwait(false);
     }
 }