OxxCommerceStarterKit.Web.Models.ViewModels.ProductListViewModel.PopulateCommonData C# (CSharp) Method

PopulateCommonData() protected method

protected PopulateCommonData ( EntryContentBase content, IMarket currentMarket, CustomerContact currentContact ) : void
content EntryContentBase
currentMarket IMarket
currentContact CustomerContact
return void
        protected void PopulateCommonData(EntryContentBase content, IMarket currentMarket, CustomerContact currentContact)
        {
            Code = content.Code;
            ContentLink = content.ContentLink;
            DisplayName = content.DisplayName ?? content.Name;
            ProductUrl = _urlResolver.GetUrl(ContentLink);
            Description = content.GetPropertyValue("Description");
            Overview = content.GetPropertyValue("Overview");
            AverageRating = content.GetPropertyValue<double>("AverageRating");

            InStock = content.GetStock() > 0;

            ContentType = content.GetType().Name;

            if (string.IsNullOrEmpty(Overview))
                Overview = Description;

            CurrentContactIsCustomerClubMember = currentContact.IsCustomerClubMember();
        }