public static bool IsValid(Employee emp) { EmployeeBs employeeObjBs = new EmployeeBs(); string EmployeeIdValue = emp.EmployeeId.ToString(); int count = employeeObjBs.GetALL().Where(x => x.EmployeeId == EmployeeIdValue).ToList().Count(); if (count != 0) { Errors.Add("EmployeeId Already Exist"); } if (Errors.Count() == 0) { return(true); } else { return(false); } }
public IHttpActionResult Get() { var emps = employeeObjBs.GetALL().OrderByDescending(x => x.CreatedDate); return(Ok(emps)); }