예제 #1
0
        public IActionResult AddStateOrgan([FromBody] StateOrganDto stateOrganDto)
        {
            if (stateOrganDto == null)
            {
                return(BadRequest("Invalid model"));
            }
            var result = _companyService.AddStateOrgan(stateOrganDto);

            return(Ok(result));
        }
예제 #2
0
        public StateOrgan AddStateOrgan(StateOrganDto stateOrganDto)
        {
            var stateOrgan = new StateOrgan
            {
                Name             = stateOrganDto.Name,
                PhysicalAddress1 = stateOrganDto.PhysicalAddress1,
                PhysicalAddress2 = stateOrganDto.PhysicalAddress2,
                Province         = stateOrganDto.Province,
                Region           = stateOrganDto.Region,
                PostalCode       = stateOrganDto.PostalCode,
                Suburb           = stateOrganDto.Suburb
            };

            _databaseContext.Add(stateOrgan);
            _databaseContext.SaveChanges();

            return(stateOrgan);
        }