예제 #1
0
 public void Add(UserDto user)
 {
     _context.Users.Add(new User()
     {
         UserName = user.UserName,
         Password = user.Password
     });
     _context.SaveChanges();
 }
 public void Add(UserDTO user)
 {
     _context.users.Add(new user
     {
         UserName = user.UserName,
         Password = user.Password
     });
     _context.SaveChanges();
 }
예제 #3
0
 public void SendMessage(ChatDTO chatDTO)
 {
     _context.Messages.Add(new Message()
     {
         Text       = chatDTO.Text,
         UserIdFrom = chatDTO.UserIdFrom,
         UserIdTo   = chatDTO.UserIdTo,
         CreatedOn  = DateTime.Now
     });
     _context.SaveChanges();
 }