Exemplo n.º 1
0
        public IHttpActionResult Post(BuildingCreateDTO newBuild)
        {
            var serviceModel = Mapper.Map <Services.Interfaces.DTO.BuildingCreateDto>(newBuild);

            serviceModel.OwnerId = User.Identity.GetUserId();
            _buildingsService.AddNewBuilding(serviceModel);

            return(Ok());
        }
Exemplo n.º 2
0
        public IHttpActionResult Put(string buildingId, [FromBody] BuildingCreateDTO buildingInfo)
        {
            var serviceModel = Mapper.Map <Services.Interfaces.DTO.BuildingCreateDto>(buildingInfo);

            serviceModel.OwnerId = User.Identity.GetUserId();

            _buildingsService.UpdateBuildingInfo(serviceModel, buildingId);

            return(Ok());
        }