示例#1
0
        public TerritoryTypeDTO GetTerritoryTypeById(int id)
        {
            var territoryType = businessManager.GetTerritoryType(id);

            TerritoryTypeDTO territoryTypeDTO = new TerritoryTypeDTO()
            {
                id   = territoryType.IdTerritoryType,
                name = territoryType.Name
            };

            return(territoryTypeDTO);
        }
        // PUT: api/TerritoriesTypes/{id}
        public IHttpActionResult Put(int id, [FromBody] TerritoryTypeDTO value)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest("Invalid data"));
            }

            ThronesTournamentManager m = new ThronesTournamentManager();

            m.UpdateTerritoryType(value.Transform());

            return(Ok());
        }
示例#3
0
        public TerritoryTypeDTO GetTerritoryTypeById(int id)
        {
            TerritoryTypeDTO territoryType = new TerritoryTypeDTO(businessManager.GetTerritoryTypeById(id));

            return(territoryType);
        }
示例#4
0
 public TerritoryTypeModel(TerritoryTypeDTO territoryType)
 {
     ID   = territoryType.ID;
     Type = territoryType.Type;
 }