public AnimalModel(Data.Entities.Models.Animal animal) { Id = animal.Id; ProfilePhotoPath = animal.ProfilePhotoPath; Name = animal.Name; Age = animal.Age; Gender = animal.Gender; ShelterName = animal.Shelter.Name; }
public AnimalDetailsModel(Data.Entities.Models.Animal animal) : base(animal) { Specie = animal.Specie; IsSterilized = animal.IsSterilized; IsGoodWithChildren = animal.IsGoodWithChildren; IsGoodWithCats = animal.IsGoodWithCats; IsGoodWithDogs = animal.IsGoodWithDogs; IsVaccinated = animal.IsVaccinated; IsRequiredExperience = animal.IsRequiredExperience; IsDangerous = animal.IsDangerous; ShelterId = animal.Shelter.Id; DocumentationLink = animal.Shelter.DocumentationFilePath; GalleryPhotoPaths = animal.AnimalPhotos.Select(p => p.PhotoPath).ToList(); var serverPath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", animal.DescriptionFilePath); Description = System.IO.File.ReadAllText(serverPath); }