public ActionResult Create([Bind(Include = "PropertyID,Name,Format")] PropertyViewModel property) { if (ModelState.IsValid) { _propertyService.Add(property); return(RedirectToAction("Index")); } return(View(property)); }
public IActionResult Add(PropertyInput property) { try { return(Ok(_propertyService.Add(property))); } catch (System.Exception e) { _logger.LogError(e, "error: {0}", e.Message); return(BadRequest()); } }
public async Task <ActionResult <Result> > Create(Property property) { var result = await _propertyService.Add(new Property { Id = Guid.NewGuid().ToString(), Name = property.Name, BankID = property.BankID, borrowerId = property.borrowerId, CreatedUsername = property.CreatedUsername, CreatedOn = DateTime.Now, UpdatedUsername = null, UpdatedOn = default(DateTime), Comments = "Property Entity Creation" }); return(Ok(result)); }
public async Task <int> SaveProperty([FromBody] PropertyDTO propertyInfo) { try { return(await _propertyService.Add(propertyInfo)); } catch (Exception ex) { using (_logger.BeginScope(new Dictionary <string, object> { { "Property", "SaveProperty" } })) { _logger.LogError(ex.Message); } throw ex; } }
public Task <IResultModel> Add(PropertyAddModel model) { return(_service.Add(model)); }