public SimpleResponse <StoreDto> Create(StoreDto dto) { var response = new SimpleResponse <StoreDto>(); try { var model = SimpleMapper.Map <StoreDto, StoreViewModel>(dto); var resp = iStoreBusiness.Create(model); response = new SimpleResponse <StoreDto>() { ResponseCode = resp.ResponseCode, ResponseMessage = resp.ResponseMessage, RCode = resp.RCode }; response.Data = SimpleMapper.Map <StoreViewModel, StoreDto>(resp.Data); } catch (Exception ex) { response.ResponseCode = BusinessResponseValues.InternalError; response.ResponseMessage = "Okuma iþleminde hata oluþtu."; SimpleFileLogger.Instance.Error(ex); } return(response); }
public IHttpActionResult CreatePost(StoreViewModel model) { var response = new SimpleResponse <StoreViewModel>(); response = iStoreBusiness.Create(model); return(Json(response)); }
public IActionResult Post([FromBody] Store store) { if (store == null) { return(BadRequest()); } return(new ObjectResult(_storeBusiness.Create(store))); }
public IActionResult CreatePost(StoreViewModel model) { var response = iStoreBusiness.Create(model); if (response.ResponseCode > 0) { return(RedirectToAction("Index")); } else { ModelState.AddModelError(string.Empty, response.ResponseMessage); return(View("Create", model)); } }
public SimpleResponse <StoreViewModel> Create(StoreViewModel model) { var response = iStoreBusiness.Create(model); return(response); }