Exemplo n.º 1
0
        public IActionResult Save(UserDto userDto)
        {
            UserDto savedUserDto = _userService.Save(userDto);

            return(new CreatedResult(
                       _servicesUtils
                       .CreateUri(
                           Request,
                           Url.RouteUrl(
                               "GetByEmailUserRoute",
                               new { email = savedUserDto.Email })),
                       savedUserDto));
        }
Exemplo n.º 2
0
        public IActionResult Save(MeterModelDto meterModelDto)
        {
            MeterModelDto savedMeterModelDto = _meterModelService.Save(meterModelDto);

            return(new CreatedResult(
                       _servicesUtils
                       .CreateUri(
                           Request,
                           Url.RouteUrl(
                               "GetByNameMeterModelRoute",
                               new { name = savedMeterModelDto.Name })),
                       savedMeterModelDto));
        }
Exemplo n.º 3
0
        public IActionResult Save(SmcModelDto smcModelDto)
        {
            SmcModelDto savedSmcModelDto = _smcModelService.Save(smcModelDto);

            return(new CreatedResult(
                       _servicesUtils
                       .CreateUri(
                           Request,
                           Url.RouteUrl(
                               "GetByNameSmcModelRoute",
                               new { name = savedSmcModelDto.Name })),
                       savedSmcModelDto));
        }
Exemplo n.º 4
0
        public IActionResult Save(RateTypeDto rateTypeDto)
        {
            RateTypeDto savedRateTypeDto = _rateTypeService.Save(rateTypeDto);

            return(new CreatedResult(
                       _servicesUtils
                       .CreateUri(
                           Request,
                           Url.RouteUrl(
                               "GetByNameRateTypeRoute",
                               new { name = savedRateTypeDto.Name })),
                       savedRateTypeDto));
        }
Exemplo n.º 5
0
        public IActionResult Save(ManufacturerDto manufacturerDto)
        {
            ManufacturerDto savedManufacturerDto = _manufacturerService.Save(manufacturerDto);

            return(new CreatedResult(
                       _servicesUtils
                       .CreateUri(
                           Request,
                           Url.RouteUrl(
                               "GetByNameManufacturerRoute",
                               new { name = savedManufacturerDto.Name })),
                       savedManufacturerDto));
        }
Exemplo n.º 6
0
        public IActionResult Save(KeysDto keysDto)
        {
            var keys = _meterKeyService.Create(keysDto);

            return(new CreatedResult(
                       _servicesUtils
                       .CreateUri(
                           Request,
                           Url.RouteUrl(
                               "GetBySerialRoute",
                               new { serial = keys.Serial })),
                       keysDto));
        }
Exemplo n.º 7
0
        public IActionResult Save(SmcDto smcDto)
        {
            SmcDto savedSmcDto = _smcService.Save(smcDto);

            _eventService.ASmcWasSavedEvent(this, new IoGServicedEventArgs <SmcDto>(savedSmcDto));
            return(new CreatedResult(
                       _servicesUtils
                       .CreateUri(
                           Request,
                           Url.RouteUrl(
                               "GetBySerialSmcRoute",
                               new { serial = savedSmcDto.Serial })),
                       savedSmcDto));
        }