public ShelterCardModel(Data.Entities.Models.Shelter shelter, Geolocation userGeolocation) { Id = shelter.Id; Name = shelter.Name; WebsiteUrl = shelter.WebsiteUrl; City = shelter.City; Address = shelter.Address; ContactPhone = shelter.ContactPhone; ContactEmail = shelter.ContactEmail; DistanceFromUser = GeolocationHelper.GetDistance(shelter.Geolocation, userGeolocation); }
public PostModel(Data.Entities.Models.Post post, Data.Entities.Models.Shelter shelter) { Title = post.Title; PhotoPath = post.PhotoPath; Timestamp = post.DateTime; ShelterName = shelter.Name; ShelterId = shelter.Id; var serverPath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", post.ContentPath); Content = File.ReadAllText(serverPath); }
public ShelterModel(Data.Entities.Models.Shelter shelter, int animalsCount) { Name = shelter.Name; City = shelter.City; Address = shelter.Address; WebsiteUrl = shelter.WebsiteUrl; ContactPhone = shelter.ContactPhone; ContactEmail = shelter.ContactEmail; Oib = shelter.Oib; Geolocation = shelter.Geolocation; var serverPath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", shelter.DocumentationFilePath); Description = File.ReadAllText(serverPath); AnimalsCount = animalsCount; }