public OperationEntity Update(UserEntity UserEntity, Guid OperationId, OperationEntity OperationEntity) { Operation Operation = context.Operations.Where(l => l.Id == OperationId).FirstOrDefault(); OperationEntity.ToModel(Operation); context.SaveChanges(); return(OperationEntity); }
public OperationEntity Create(UserEntity UserEntity, OperationEntity OperationEntity) { OperationEntity.Id = Guid.NewGuid(); Operation Operation = OperationEntity.ToModel(); context.Operations.Add(Operation); context.SaveChanges(); return(OperationEntity); }