public DealSpecificProductMerchantViewModel(Merchant model) { CompanyName = model.Name; About = model.About; Website = model.Website; FullAddress = model.Address; if (model.AddressLat.HasValue) { AddressLat = model.AddressLat.Value.ToString(); } if (model.AddressLng.HasValue) { AddressLng = model.AddressLng.Value.ToString(); } }
private static IList<Merchant> CreateMerchants(DealsContext context) { var merchants = new List<Merchant>(); for (int i = 0; i < 10; i++) { var merchant = new Merchant { BusinessRegNumber = "RegNumber", EmailAddress = "*****@*****.**", Id = Guid.NewGuid(), Website = "http://www.website.com", PhoneNumber = "010-20318122", Name = string.Format("Merchant {0}", i), About = "About merchant", Address = "address" }; merchants.Add(merchant); context.Merchants.Add(merchant); } return merchants; }