public void UpdateUser(FrameworkTables.User user) { SovaContext db = new SovaContext(); db.Update(user); db.SaveChanges(); }
private UsersDto CreateuserDto(SovaDataAccessLayer.FrameworkTables.User user) { var dto = _mapper.Map <UsersDto>(user); dto.Link = Url.Link( nameof(GetUser), new { userId = user.Id }); return(dto); }
public ActionResult UpdateUser(int userId, SovaDataAccessLayer.FrameworkTables.User user) { if (!_dataService.UserExcist(userId)) { return(NotFound()); } user.Id = userId; _dataService.UpdateUser(user); return(NoContent()); }
public void CreateUser(FrameworkTables.User user) { SovaContext db = new SovaContext(); var tmpList = db.Users.ToList(); if (tmpList.Count() == 0) { user.Id = 1; } else { user.Id = db.FrameworkUsers.Max(x => x.Id) + 1; } db.Add(user); db.SaveChanges(); }