public List <CategoryDTO> GetAllCategories(Guid userId) { List <CategoryDTO> categoryDTOs = new List <CategoryDTO>(); IQueryable <Category> categories = _categoryDAL.GetEntities(m => m.CategoryUserId == userId); foreach (Category category in categories) { categoryDTOs.Add(new CategoryDTO() { Id = category.CategoryId, CategoryName = category.CategoryName }); } return(categoryDTOs); }