feed table added

This commit is contained in:
chsakell
2016-10-03 13:09:12 +03:00
parent 4f2b3ea97f
commit 66d1a2a07f
10 changed files with 93 additions and 74 deletions

View File

@@ -1,4 +1,5 @@
using AutoMapper;
using System.Collections.Generic;
using AutoMapper;
using LiveGameFeed.Models;
namespace LiveGameFeed.Core.Mappings
@@ -8,7 +9,9 @@ namespace LiveGameFeed.Core.Mappings
protected override void Configure()
{
Mapper.CreateMap<Match, MatchViewModel>()
.ForMember(m => m.Type, map => map.MapFrom(m => m.Type.ToString()));
.ForMember(vm => vm.Type, map => map.MapFrom(m => m.Type.ToString()))
.ForMember(vm => vm.Feeds, map => map.MapFrom(m =>
Mapper.Map<ICollection<Feed>, ICollection<FeedViewModel>>(m.Feeds)));
Mapper.CreateMap<Feed, FeedViewModel>();
}
}