Пример #1
0
 private int GetCount()
 {
     using (var db = new HrContext())
     {
         return(db.Employees.Count(x => x.PostId == Id));
     }
 }
Пример #2
0
 private string GetPostName()
 {
     using (var db = new HrContext())
     {
         return(db.Posts.Where(x => x.Id == PostId).ToList().Select(item => item.Name).FirstOrDefault());
     }
 }
Пример #3
0
 private List <Posts> GetPosts()
 {
     using (var db = new HrContext())
     {
         return(new List <Posts>(db.Posts.Where(x => x.DepartmentId == Id).ToList()));
     }
 }