Basically, Im not sure why this error request is coming up...
here is the bulk of the code.
It's saying the error on this line of code
Customer customer = (context.Execute<Customer>(new Uri("GetAuthenticatedCustomer", UriKind.Relative), "POST", false, opParams)).FirstOrDefault();
Please shed some light! Thanks
private void loginButton_Click(object sender, RoutedEventArgs e)
{
if (!string.IsNullOrEmpty(emailAddressTextbox.Text) && !string.IsNullOrEmpty(passwordTextbox.Text))
{
Uri svcUri = new Uri("http://localhost:29875/iShop.svc");
iShopEntities context = new iShopEntities(svcUri);
UriOperationParameter[] opParams = new UriOperationParameter[2];
opParams[0] = new UriOperationParameter("EmailAddress", emailAddressTextbox.Text);
opParams[1] = new UriOperationParameter("Password", passwordTextbox.Text);
Customer customer = (context.Execute<Customer>(new Uri("GetAuthenticatedCustomer", UriKind.Relative), "POST", false, opParams)).FirstOrDefault();
Seller seller = (context.Execute<Seller>(new Uri("GetAuthenticatedSeller", UriKind.Relative), "POST", false, opParams)).FirstOrDefault();
if (customer != null)
{
MessageBox.Show("Welcome " + customer.FirstName);
}
else if (seller != null)
{
MessageBox.Show("Welcome " + seller.FirstName);
}
}
else
{
MessageBox.Show("Please specify email and password");
}
}