public async Task <FormUserAuthorizationEntity> Create(FormUserAuthorizationEntity item) { item.Id = Guid.NewGuid(); item.CreatedDateTime = DateTime.Now; var entity = context.FormUserAuthorizations.Add(item); context.SaveChanges(); return(entity); }
public async void Delete(Guid id) { using (var context = new FormsEntities()) { var entity = context.FormDetailsTypes.Find(id); context.FormDetailsTypes.Remove(entity); context.SaveChanges(); } }
public AspNetUsersInfoEntity Create(AspNetUsersInfoEntity item) { using (var context = new FormsEntities()) { context.AspNetUsersInfoes.Add(item); context.SaveChanges(); return(item); } }
public async Task <ValueDetailEntity> Create(ValueDetailEntity item) { if (item.Id == null || item.Id == Guid.Empty) { item.Id = Guid.NewGuid(); } else { item.Id = new Guid(item.Id.ToString()); } if (item.Value == null) { item.Value = ""; } item.CreatedDateTime = DateTime.Now; context.ValueDetails.Add(item); context.SaveChanges(); return(item); }
public async Task <ValueEntity> Update(Guid id, ValueEntity item) { using (var context = new FormsEntities()) { var entity = context.Values.Find(id); entity.ModifiedDateTime = DateTime.Now; context.SaveChanges(); return(entity); } }
public async Task <FormDetailsTypeEntity> Update(Guid id, FormDetailsTypeEntity item) { using (var context = new FormsEntities()) { var entity = context.FormDetailsTypes.Find(id); entity.Name = item.Name; entity.ModifiedDateTime = DateTime.Now; context.SaveChanges(); return(entity); } }
public async Task <FormDetailsTypeEntity> Create(FormDetailsTypeEntity item) { using (var context = new FormsEntities()) { item.Id = Guid.NewGuid(); item.CreatedDateTime = DateTime.Now; var entity = context.FormDetailsTypes.Add(item); context.SaveChanges(); return(entity); } }
public async void Delete(Guid id) { using (var context = new FormsEntities()) { var entity = context.Values.Find(id); if (entity != null) { context.Values.Remove(entity); context.SaveChanges(); } } }
public async Task <FormEntity> Update(Guid id, FormEntity item) { using (var context = new FormsEntities()) { var entity = context.Forms.Find(id); entity.Name = item.Name; entity.Description = item.Description; entity.PublishUrl = item.PublishUrl; entity.ModifiedDateTime = DateTime.Now; context.SaveChanges(); return(entity); } }
public async Task <ValueEntity> Create(ValueEntity item) { using (var context = new FormsEntities()) { if (item.Id == null || item.Id == Guid.Empty) { item.Id = Guid.NewGuid(); } else { item.Id = new Guid(item.Id.ToString()); } item.CreatedDateTime = DateTime.Now; context.Values.Add(item); context.SaveChanges(); return(item); } }
private void DoFireAndForgetAsync(XXX model) { try { using (var ctx = new FormsEntities()) { var dbXXX = new DALXXX(); dbXXX.Foo = model.Foo; ctx.DALXXX.Add(dbXXX); ctx.SaveChanges(); } }catch (Exception ex) { // Remember that the Async code needs to handle its own // exceptions, as the "DoFireAndForget" method will never fail Log.Log.LogError(ex.GetMostInnerException(), "whatever"); } }