public ActionResult <VisitorDb> AddVisit([FromBody] VisitorDb info) { VisitorDb newVisit = new VisitorDb { FirstName = info.FirstName, Surname = info.Surname, Company = info.Company, Role = info.Role, Telephone = info.Telephone, Email = info.Email, EmployeeEmail = info.EmployeeEmail, Appointment = info.Appointment, }; _visitorContext.Visitor.Add(newVisit); _visitorContext.SaveChanges(); return(Ok(new{ visit = newVisit })); }
public ActionResult <ResponseModel> AddVisitor([FromBody] VisitorModel model) { var storageVisitor = Mapper.ConvertVisitorDomainModelToStorage(model); dbContext.Visitors.Add(storageVisitor); dbContext.SaveChanges(); return(new ResponseModel { IsSuccess = true, Message = "Save Successful." }); }
public IActionResult Post([FromBody] Visitor visitor) { if (visitor == null) { return(BadRequest()); } _context.Visitors.Add(visitor); _context.SaveChanges(); return(Ok()); }
public ActionResult <Visitor> Poststring(Visitor visitor) { _visitorContext.Visitors.Add(visitor); _visitorContext.SaveChanges(); return(visitor); }
public ActionResult <User> Regist(User user) { ctx.Users.Add(user); ctx.SaveChanges(); return(Ok(user)); }
public void Add(Visitor item) { _context.Visitors.Add(item); _context.SaveChanges(); }