コード例 #1
0
 public ActionResult Create([Bind(Include = "PropertyID,Name,Format")] PropertyViewModel property)
 {
     if (ModelState.IsValid)
     {
         _propertyService.Add(property);
         return(RedirectToAction("Index"));
     }
     return(View(property));
 }
コード例 #2
0
 public IActionResult Add(PropertyInput property)
 {
     try
     {
         return(Ok(_propertyService.Add(property)));
     }
     catch (System.Exception e)
     {
         _logger.LogError(e, "error: {0}", e.Message);
         return(BadRequest());
     }
 }
コード例 #3
0
        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));
        }
コード例 #4
0
 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;
     }
 }
コード例 #5
0
 public Task <IResultModel> Add(PropertyAddModel model)
 {
     return(_service.Add(model));
 }