Summary

Class:ProjectX.Ef.Stores.EventCategoryStore
Assembly:ProjectX.Ef
File(s):C:\private\projects\projectx\backend\src\ProjectX.Ef\Stores\EventCategoryStore.cs
Covered lines:13
Uncovered lines:0
Coverable lines:13
Total lines:35
Line coverage:100%

History

Metrics

MethodCyclomatic complexity  NPath complexity  Sequence coverage  Branch coverage  
.ctor(...)10100100
LoadEventCategoriesAsync()30100100

File(s)

C:\private\projects\projectx\backend\src\ProjectX.Ef\Stores\EventCategoryStore.cs

#LineLine coverage
 1using System.Linq;
 2using System.Threading.Tasks;
 3using Microsoft.EntityFrameworkCore;
 4using ProjectX.Entities;
 5using ProjectX.Models;
 6using ProjectX.Stores;
 7
 8namespace ProjectX.Ef.Stores
 9{
 10    public class EventCategoryStore : IEventCategoryStore
 11    {
 12        private readonly MainDbContext _dbContext;
 13
 614        public EventCategoryStore(MainDbContext dbContext)
 15        {
 616            this._dbContext = dbContext;
 617        }
 18
 19        public async Task<PagedList<EventCategory>> LoadEventCategoriesAsync(
 20            int take,
 21            int skip = 0)
 22        {
 223            var q = this._dbContext.EventCategories.AsNoTracking()
 224                .Where(c => c.DeletedAt == null);
 25
 226            return new PagedList<EventCategory>
 227            {
 228                Total = q.Count(),
 229                Take = take,
 230                Skip = skip,
 231                Items = await q.Skip(skip).Take(take).ToArrayAsync()
 232            };
 233        }
 34    }
 35}