public List<User> GetAllUsers()
 {
     using (var entities = new EazyWizyEntities())
     {
         var result = entities.GetAllUsers();
         return (from item in result
             select
                 new User()
                 {
                     CreateDate = item.CreateDate,
                     CreatedBy = item.CreatedBy,
                     EmailID = item.EmailID,
                     FirstName = item.FirstName,
                     HashId = item.HashId,
                     IsActive = item.IsActive,
                     LastName = item.LastName,
                     ModifiedBy = item.ModifiedBy,
                     Password = item.Password,
                     ModifiedDate = item.ModifiedDate,
                     RoleID = item.RoleID,
                     RoleName = item.RoleName,
                     UserID = item.UserID
                 }).ToList();
     }
 }
 public void ActiveDeactiveCategory(long categoryId, bool status)
 {
     using (var entities = new EazyWizyEntities())
     {
         entities.ManageCategory(categoryId, null, null, null,
             null, status, null, (int)DatabaseAction.ActiveDeactive);
     }
 }
 public void AddCategory(Category entity)
 {
     using (var entities = new EazyWizyEntities())
     {
         entities.ManageCategory(entity.CategoryId, entity.ParentCategoryId,
             entity.Name, entity.Description, entity.ImageName, entity.IsActive,
             null, (int) DatabaseAction.Insert);
     }
 }
 public List<Category> GetAllCategories()
 {
     using (var entities = new EazyWizyEntities())
     {
         var result = entities.GetAllCategories();
         return (from item in result
             select
                 new Category()
                 {
                     CategoryId = item.CategoryId,
                     ImageName = item.ImageName,
                     Description = item.Description,
                     IsActive = item.IsActive.HasValue && item.IsActive.Value,
                     Name = item.Name,
                     ParentCategoryId = item.ParentCategoryId
                 }).ToList();
     }
 }
 public void RemoveCategory(long id)
 {
     using (var entities = new EazyWizyEntities())
     {
         entities.ManageCategory(id, null, null, null, null, null, null, (int) DatabaseAction.Delete);
     }
 }
 public User GetUser(string email)
 {
     using (var entities = new EazyWizyEntities())
     {
         var result = entities.GetUser(email);
         return (from item in result
             select
                 new User()
                 {
                     CreateDate = item.CreateDate,
                     CreatedBy = item.CreatedBy,
                     EmailID = item.EmailID,
                     FirstName = item.FirstName,
                     HashId = item.HashId,
                     IsActive = item.IsActive,
                     LastName = item.LastName,
                     ModifiedBy = item.ModifiedBy,
                     Password = item.Password,
                     ModifiedDate = item.ModifiedDate,
                     RoleID = item.RoleID,
                     RoleName = item.RoleName,
                     UserID = item.UserID
                 }).SingleOrDefault();
     }
 }