public void TestSaveMarket() { Address address = new Address(); address.Address1 = "First Address"; address.Address2 = "Second Address"; Market market = new Market.Builder() .SetName("Test Market") .SetDescription("This is my Test Market") .SetAddress(address) .Build(); marketService.Save(market); }
public void AddMarket([FromBody] JObject ProductObject) { Address address = new Address.Builder() .SetEmail(ProductObject["Email"].ToString()) .SetPhoneNumber(ProductObject["PhoneNumber"].ToString()) .SetPrimaryAddress(ProductObject["PrimaryAddress"].ToString()) .SetSecondaryAddress(ProductObject["SecondaryAddress"].ToString()) .Build(); Market market = new Market.Builder() .SetName(ProductObject["Name"].ToString()) .SetDescription(ProductObject["Description"].ToString()) .SetAddress(address) .Build(); marketService.Save(market); }