public async Task<IHttpActionResult> AddValue(model::CreateCustomPropertyValueViewModel model)
 {
     if (!ModelState.IsValid)
     {
         return Error();
     }
     var property = await _propertiesRepository.GetAsync(model.PropertyId).WithoutSync();
     if (property != null)
     {
         CustomPropertyValue value = Mapper.Map<CustomPropertyValue>(model);
         value.CustomProperty = property;
         _valuesRepository.Insert(value);
         await _valuesRepository.SaveAsync().Sync();
         return Ok(value.Id);
     }
     return NotFound();
 }
 public async Task<IHttpActionResult> CreateProperty(model::CreateCustomPropertyViewModel model)
 {
     if (!ModelState.IsValid)
     {
         return Error();
     }
     var property = Mapper.Map<CustomProperty>(model);
     var unit = await _unitsRepository.GetAsync(model.UnitId);
     if (unit != null && unit.AdministratorId == User.Identity.GetUserId())
     {
         property.Unit = unit;
         _propertiesRepository.Insert(property);
         await _propertiesRepository.SaveAsync();
         return Ok(property.Id);
     }
     return BadRequest();
 }