void PrintAll()
        {
            IEnumerable <Dept> deptCollection = deptService.GetAll();

            foreach (Dept item in deptCollection)
            {
                Console.WriteLine(item.Id + " \t " + item.DName + " \t " + item.Loc);
            }
        }
 public IHttpActionResult GetAll()
 {
     try
     {
         var Depts = _service.GetAll();
         return(Ok(Depts));
     }
     catch (Exception ex)
     {
         return(InternalServerError());
     }
 }
Example #3
0
 public IEnumerable <Dept> Get()
 {
     return(_service.GetAll());
 }