Tuesday, September 27, 2016

To check if any record exist in the table using linq c#



public void CheckRecordExistOrNot()
        {
            var query = (from td in dbcontext.taskdetails select td).ToList();

            if (query.Count > 0)
            {
                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...