private int GetCount() { using (var db = new HrContext()) { return(db.Employees.Count(x => x.PostId == Id)); } }
private string GetPostName() { using (var db = new HrContext()) { return(db.Posts.Where(x => x.Id == PostId).ToList().Select(item => item.Name).FirstOrDefault()); } }
private List <Posts> GetPosts() { using (var db = new HrContext()) { return(new List <Posts>(db.Posts.Where(x => x.DepartmentId == Id).ToList())); } }