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 Task <FormDetailsTypeEntity> Update(Guid id, FormDetailsTypeEntity item) { return(await repository.Update(id, item)); }
public async Task <FormDetailsTypeEntity> Create(FormDetailsTypeEntity item) { return(await repository.Create(item)); }