public IHttpActionResult GetSimpleParentTouristSites(int page = 1, ParentTouristSiteType type = 0) { var result = this.touristSites.GetParentTouristSites(page - 1, (int)type); var mapper = AutoMapperConfig.MapperConfig.CreateMapper(); var mappedResult = mapper.Map<IEnumerable<SimpleParentTouristSiteResponseModel>>(result); return this.Ok(mappedResult); }
public ParentTouristSite AddParentTouristSite(string name, string description, ParentTouristSiteType type) { ParentTouristSite parentTouristSite = new ParentTouristSite { Name = name, Description = description, Type = type }; this.parentTouristSites.Add(parentTouristSite); this.parentTouristSites.SaveChanges(); return parentTouristSite; }