public User CreateUser(string userName) { var user = new User { UserName = userName }; _context.Users.Add(user); return(user); }
public async Task <User> CreateUserAsync(string userName) { var user = new User { UserName = userName }; _ = await _context.Users.AddAsync(user); return(user); }
public async Task <PhotoUser> CreatePhotoUserAsync(Photo photo, User user) { var photoUser = new PhotoUser { Photo = photo, User = user }; await _context.PhotoUsers.AddAsync(photoUser); return(photoUser); }
public PhotoUser CreatePhotoUser(Photo photo, User user) { var photoUser = new PhotoUser { Photo = photo, User = user }; _context.PhotoUsers.Add(photoUser); return(photoUser); }
public bool ExistsUserByUserName(string userName, out User user) { user = _context.Users.FirstOrDefault(u => u.UserName == userName); return(user != null); }