public PetProfileViewModel PetToProfileViewModel(Pet pet) { var defaultPetImage = ConfigurationManager.AppSettings["DefaultImagePetProfile"].ToString(); return(new PetProfileViewModel { Code = pet.Code.ToString(), Name = HttpUtility.HtmlDecode(pet.Name), SelectedSexTypeId = pet.SexType, DateOfBirth = pet.DateOfBirth.Date, Description = HttpUtility.HtmlDecode(pet.Description), ProfileImageUrl = !string.IsNullOrEmpty(pet.ProfileImageUrl) ? _generalHelper.FormatSiteImageUrl(pet.ProfileImageUrl) : defaultPetImage, Status = _generalHelper.GetPetStatus(pet.Status), StatusId = (PetStatusEnum)pet.Status }); }
public PetImageViewModel PetImageToPetImageViewModel(PetImage petImage) { return(new PetImageViewModel { Id = petImage.Id, Code = petImage.Code.ToString(), ImageUrl = _generalHelper.FormatSiteImageUrl(petImage.ImageUrl), IsProfileImage = petImage.IsProfileImage }); }
private string FormatSiteImageUrl(string imageUrl) { return(_generalHelper.FormatSiteImageUrl(imageUrl)); }