public IHttpActionResult Add(AddBookRequest book) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var addbook = Mapper.Map <Book>(book); _bookRepository.Add(DatabaseTableNames.Books, addbook); return(Ok(book)); }
public void Add(Order order) { _mongoDbRepository.Add(Convert(order)); }
public IHttpActionResult Register([FromBody] User user) { user.RoleId = "1"; _userRepository.Add("user", user); return(Ok(user)); }