public AdDto GetAdAndApplyDiscount(string adId, int discount) { Ad ad = this.adQueryRepository.GetById(new AdId(adId)); ad.ApplyDiscount(discount); //TO-DO: Configure Mapper interface & provider return(new Ads.DTO.AdDto() { Id = ad.Id.Id, Amount = ad.Price.Amount, IsoCode = ad.Price.Currency.Iso.ToString() }); //* }
public AdDto GetAdTitleContainsAndApplyDiscount(string searchWord, int discount) { Ad ad = this.adQueryRepository.GetBySearchText(searchWord); ad.ApplyDiscount(discount); //TO-DO: Configure Mapper interface & provider return(new Ads.DTO.AdDto() { Id = ad.Id.Id, Amount = ad.Price.Amount, IsoCode = ad.Price.Currency.Iso.ToString() }); //* }