Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- context.Customers newCustomer = context.Customers.CreateCustomer(...);
- newCustomer.FirstName = firstNameTextBox.Text;
- newCustomer.Address.Street = streetTextBox.Text; // this is where the error is thrown
- newCustomer.Address = new Address()
- {
- Street = streetTextBox.Text,
- // etc.
- };
- newCustomer.Address = (from Addresses in context where ...).FirstOrDefault();
- if (newCustomer.Address == null)
- {
- newCustomer.Address = new Address()
- {
- Street = streetTextBox.Text,
- // etc.
- };
- }
Add Comment
Please, Sign In to add comment