public ActionResult PostServiceType([FromBody] ServiceTypeDto serviceTypeDto) { var response = _service.Add(serviceTypeDto); _service.Save(response); return(new OkObjectResult(response["Output"])); }
public ActionResult Create([Bind(Include = "Id,ServiceName")] ServiceType serviceType) { if (ModelState.IsValid) { Service.Add(serviceType); return(RedirectToAction("Index")); } return(View(serviceType)); }
public void AddServiceType() { _service.Add(new ServiceTypeDto { Id = "3", Name = "name3" }); _service.Save(_dbContextMock); var result = _service.GetAll(); var count = result.Count(); Assert.AreEqual(3, count); }