3
Answers

How to return json result true when exist and false when not exist

Photo of ahmed salah

ahmed salah

1y
523
1

I working on mvc asp.net csharp i need to make function return json result when branch code exist then return true and if not exist return false so can you help me do this function return json result true or false

public JsonResult CheckExist(string BranchCode)
{
 string branches = _db.Branch.Single(x => x.iBranchCode == BranchCode).iBranchCode.ToString();
// so what i write here to return true or false
}

Answers (3)