public ActionResult Create( CatalogEntryModel catalogEntryModel ) { CatalogEntry entry = catalogEntryModel.ToServiceModel(); if ( ModelState.IsValid ) { _catalogService.Add( entry ); return RedirectToAction( "Index" ); } catalogEntryModel.LicensingBases = _licenseTypeService.GetLicensingBases(); return View( catalogEntryModel ); }
public ActionResult Create() { CatalogEntryModel catalogEntryModel = new CatalogEntryModel(); catalogEntryModel.LicensingBases = _licenseTypeService.GetLicensingBases(); return View( catalogEntryModel ); }
public static CatalogEntryModel ToViewModel( this CatalogEntry model ) { CatalogEntryModel catalogEntryModel = new CatalogEntryModel { Id = model.Id, ProductName = model.ProductName, ProductVersion = model.ProductVersion, Blurb = model.Blurb, Price = model.Price, SkuId = model.SkuId, LicensingBasis = model.LicensingBasis }; return catalogEntryModel; }