开发者

Entity types cannot be generic

开发者 https://www.devze.com 2023-03-10 15:40 出处:网络
I am using the following function in the Domain Service, public IQueryable<Dictionary<discussion_category, List<discussion_board>>> GetDiscussion_categoriesWithBoards()

I am using the following function in the Domain Service,

public IQueryable<Dictionary<discussion_category, List<discussion_board>>> GetDiscussion_categoriesWithBoards()
{
    return new[] {
        GetDiscussion_categories().Select(c => new {
            Category = c,
            Boards = GetDiscussion_boardsByCa开发者_开发知识库tegory(c.ID).ToList()
        }).ToDictionary(i => i.Category, i => i.Boards.ToList())
    }.AsQueryable();
}

seems to have no errors and i get the following error while compiling,

Type 'Dictionary`2' is not a valid entity type. Entity types cannot be generic.

what could be the problem?


The type Dictionary<discussion_category, List<discussion_board>> is not a valid type to send over Ria services, unfortunately you can only send IQueryable<Entity> (As far as I can remember)

If you want to send something else, you might want to have a look at the InvokeOperation and creating Complex Types (see Complex types in this blog).

0

精彩评论

暂无评论...
验证码 换一张
取 消