im using asp.net mvc 5 im new bee here. my problem is i have a tbl_register the content is
Username
password
repeat-password
contact number
then i fill up the form, all i need is to validate if the contact number is existing to another table in tbl_client. this is my code. my code is not working
- var agent = _clientService.Find(x => x.ContactPrimary == newUser.ContactNumber);
- if (agent != null)
- {
- var client = new Client
- {
- ParentClientId = agent.FirstOrDefault().Id,
- FirstName = "",
- LastName = "",
- MiddleName = "",
- Suffix = "",
- ContactPrimary = "",
- ContactSecondary = "",
- Age = 0,
- Gender = "",
- CountryId = 0,
- StateId = 0,
- CityId = 0,
- TownId = 0,
- EmailAddress = "",
- Postcode = 0,
- Commission = 0,
- SubAgentCommissionPercentage = 0,
- Address = ""
- };
- _clientService.Add(client);
- }

Sonu GuptaRank #1,261 · 1.4K reputationPosted Aug 25, 2019, 7:19 PM EDT
Bidyasagar MishraRank #766 · 3K reputationPosted Aug 25, 2019, 6:54 PM EDT
Denmark PusoRank #7,130 · 248 reputationPosted Aug 28, 2019, 7:04 PM EDT
Sonu Gupta