fix feeds order

This commit is contained in:
chsakell
2016-10-05 16:19:02 +03:00
parent 0d8e383a22
commit 09ef60ddf4
3 changed files with 5 additions and 4 deletions

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Linq;
using AutoMapper;
using LiveGameFeed.Models;
@@ -11,7 +12,7 @@ namespace LiveGameFeed.Core.Mappings
Mapper.CreateMap<Match, MatchViewModel>()
.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.Map<ICollection<Feed>, ICollection<FeedViewModel>>(m.Feeds.OrderByDescending(f => f.Id).ToList())));
Mapper.CreateMap<Feed, FeedViewModel>();
}
}