Esempio n. 1
0
        public async Task <ApiResult> UpdateHazardAsync(HazardDto hazardDto)
        {
            var hazard = new Hazard();

            Mapper.Map(hazardDto, hazard);
            var updatedHazard = await hazardRepository.UpdateHazardAsync(hazard, hazardDto.MappingScheme);

            var apiResult = new ApiResult(MessageType.Success);

            return(apiResult);
        }
Esempio n. 2
0
        public async Task <ApiResult> CreateHazardAsync(HazardDto hazardDto)
        {
            var hazard = new Hazard();

            Mapper.Map(hazardDto, hazard);
            var insertedId = await hazardRepository.CreateHazardAsync(hazard, hazardDto.MappingScheme);

            var apiResult = new ApiResult(MessageType.Success);

            apiResult.AdditionalDetails.Add("insertedId", insertedId);

            return(apiResult);
        }
Esempio n. 3
0
 internal object Select(HazardDto icingDto)
 {
     throw new NotImplementedException();
 }
        public async Task <IHttpActionResult> UpdateHazard(HazardDto hazardDto)
        {
            await hazardManager.UpdateHazardAsync(hazardDto);

            return(Ok());
        }
        public async Task <IHttpActionResult> CreateHazard(HazardDto hazardDto)
        {
            var hazardId = await hazardManager.CreateHazardAsync(hazardDto);

            return(Ok(hazardId));
        }