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