public static ProductFlavour Map(this tblProductFlavour productFlavour) { ProductFlavour pf = new ProductFlavour(productFlavour.id) { Name = productFlavour.name, Description = productFlavour.description, Code = productFlavour.code, }; pf._SetStatus((EntityStatus)productFlavour.IM_Status); pf._SetDateCreated(productFlavour.IM_DateCreated); pf._SetDateLastUpdated(productFlavour.IM_DateLastUpdated); return pf; }
protected Guid AddProductFlavour(string name, string desc, string code, Guid brandId) { ProductFlavour pf = new ProductFlavour(Guid.NewGuid()) { Name = name, Description = desc, Code = code, ProductBrand = _productBrandRepository.GetById(brandId), }; pf._SetStatus(EntityStatus.Active); return _productFlavourRepository.Save(pf); }