Tuesday, September 27, 2016

To check the If Exist condition (SqlServer) in linq using c#



public void IfExist(string username)
        {
            var name = dbcontext.userdetails.Any(s => s.username == username);

            if (name == true)
            {
                Console.WriteLine("Record Exists");
            }
            else
            {
                Console.WriteLine("Record Does Not Exists");
            }
        }

No comments:

Post a Comment

Git Commands

Git Version   To check the git version Git -v       Git Clone To clone the repository, use the following command: Git clone [u...