Summary

Class:ProjectX.PublicApi.Actions.Categories.EventCategoryModelExtensions
Assembly:ProjectX.PublicApi
File(s):C:\private\projects\projectx\backend\src\ProjectX.PublicApi\Actions\Categories\EventCategoryModelExtensions.cs
Covered lines:16
Uncovered lines:0
Coverable lines:16
Total lines:35
Line coverage:100%

History

Metrics

MethodCyclomatic complexity  NPath complexity  Sequence coverage  Branch coverage  
ToModel(...)10100100
ToModel(...)10100100

File(s)

C:\private\projects\projectx\backend\src\ProjectX.PublicApi\Actions\Categories\EventCategoryModelExtensions.cs

#LineLine coverage
 1using ProjectX.Entities;
 2using ProjectX.Models;
 3using System.Linq;
 4
 5namespace ProjectX.PublicApi.Actions.Categories
 6{
 7    public static class EventCategoryModelExtensions
 8    {
 9        public static EventCategoryModel ToModel(
 10             this EventCategory entity)
 11        {
 512            return new EventCategoryModel
 513            {
 514                Id = entity.Id,
 515                ImageId = entity.ImageId,
 516                Title = entity.Title,
 517                Info = entity.Info
 518            };
 19        }
 20
 21        public static PagedList<EventCategoryModel> ToModel(
 22            this PagedList<EventCategory> entity)
 23        {
 224            return new PagedList<EventCategoryModel>
 225            {
 226                Total = entity.Total,
 227                Skip = entity.Skip,
 228                Take = entity.Take,
 229                Items = entity.Items
 230                      .Select(EventCategoryModelExtensions.ToModel)
 231                      .ToArray()
 232            };
 33        }
 34    }
 35}