public static IDataImage ToImage(this Image.Image input) { return(new DataImage { Id = input.Id, Caption = input.Caption, PublicKey = input.Caption, CreatedDate = input.CreatedDate, CreatedBy = input.CreatedBy, Url = input.Url }); }
public async Task UpdateSellerInfo( long SellerId, string Name, string Address, string PhoneNumber, string Description, long?CoverImage, long?Logo) { Seller seller = await SellerRepository.GetAsync(SellerId); if (CoverImage.HasValue) { Image.Image oldImage = seller.SellerCover?.Image; if (oldImage == null || oldImage?.Id != CoverImage.Value) { SellerCover cover = new SellerCover { ImageId = CoverImage.Value }; seller.SellerCover = cover; } } if (Logo.HasValue) { Image.Image oldImage = seller.SellerCover?.Image; if (oldImage == null || oldImage.Id != Logo.Value) { SellerLogo logo = new SellerLogo { ImageId = Logo.Value }; seller.SellerLogo = logo; } } seller.Name = Name; seller.Address = Address; seller.PhoneNumber = PhoneNumber; seller.Description = Description; await SellerRepository.UpdateAsync(seller); await CurrentUnitOfWork.SaveChangesAsync(); }
public async Task EditBrand(long BrandId, string BrandName, long?BrandImage, string Description) { Brand brand = await GetBrand(BrandId); if (BrandImage.HasValue) { Image.Image oldImage = brand.BrandImage.Image; if (oldImage.Id != BrandImage) { BrandImage brandImage = new BrandImage { ImageId = BrandImage.Value }; brand.BrandImage = brandImage; } } brand.Description = Description; brand.Name = BrandName; await Repository.UpdateAsync(brand); await CurrentUnitOfWork.SaveChangesAsync(); }
public HomeController(Image.Image image) { _image = image; }
public Series() { TitleImage = new Image.Image(); Projects = new List <Project>(); }
public Project() { TitleImage = new Image.Image(); Images = new List <Image.Image>(); }
public ImagesController(Image.Image image) { _image = image; }
public Profile() { Image = new Image.Image(); }