예제 #1
0
        public async Task <IActionResult> Add([FromBody] FacilityTypeDTO facilityType)
        {
            var outputHandler = await _service.Add(facilityType);

            if (outputHandler.IsErrorOccured)
            {
                return(BadRequest(outputHandler.Message));
            }

            return(Created("", outputHandler.Message));
        }
예제 #2
0
 public ActionResult <string> Add(FacilityTypeRequest ftData)
 {
     try
     {
         var facilityType = _facilityTypeService.Add(ftData);
         return(string.IsNullOrEmpty(facilityType) ? $"Unable to add facility type data" : facilityType);
     }
     catch (Exception e)
     {
         return($"Unable to add facility type data - {e.Message}");
     }
 }