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()); }
public TerritoryTypeDTO GetTerritoryTypeById(int id) { TerritoryTypeDTO territoryType = new TerritoryTypeDTO(businessManager.GetTerritoryTypeById(id)); return(territoryType); }
public TerritoryTypeModel(TerritoryTypeDTO territoryType) { ID = territoryType.ID; Type = territoryType.Type; }