コード例 #1
0
ファイル: UserController.cs プロジェクト: dwenndson/TesteSMI
        public IActionResult Save(UserDto userDto)
        {
            UserDto savedUserDto = _userService.Save(userDto);

            return(new CreatedResult(
                       _servicesUtils
                       .CreateUri(
                           Request,
                           Url.RouteUrl(
                               "GetByEmailUserRoute",
                               new { email = savedUserDto.Email })),
                       savedUserDto));
        }
コード例 #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));
        }
コード例 #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));
        }
コード例 #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));
        }
コード例 #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));
        }
コード例 #6
0
ファイル: KeysController.cs プロジェクト: dwenndson/TesteSMI
        public IActionResult Save(KeysDto keysDto)
        {
            var keys = _meterKeyService.Create(keysDto);

            return(new CreatedResult(
                       _servicesUtils
                       .CreateUri(
                           Request,
                           Url.RouteUrl(
                               "GetBySerialRoute",
                               new { serial = keys.Serial })),
                       keysDto));
        }
コード例 #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));
        }