Add support for Indexed Dtos ...
This commit is contained in:
@@ -4,8 +4,8 @@ namespace xModels.Dtos
|
|||||||
{
|
{
|
||||||
public class XBaseIndexedDto<T, TIndex> : XBaseDto
|
public class XBaseIndexedDto<T, TIndex> : XBaseDto
|
||||||
{
|
{
|
||||||
TIndex Index { get; set; }
|
public TIndex Index { get; set; }
|
||||||
T Item { get; set; }
|
public T Item { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class XBaseIntIndexedDto<T> : XBaseIndexedDto<T, int> { }
|
public class XBaseIntIndexedDto<T> : XBaseIndexedDto<T, int> { }
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using xCommons.Extensions;
|
using xCommons.Extensions;
|
||||||
using xModels.Dtos;
|
using xModels.Dtos;
|
||||||
|
|
||||||
@@ -30,5 +33,12 @@ namespace xModels.Extensions
|
|||||||
//
|
//
|
||||||
return isSame;
|
return isSame;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static IEnumerable<T> AsEnumerable<T, TIndex>(
|
||||||
|
this IEnumerable<XBaseIndexedDto<T, TIndex>> source
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return source.Select(i => i.Item);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user