Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7440703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:53:37+00:00 2026-05-29T10:53:37+00:00

I have an entity framework Complex Type(Activity) I have mapped to a SP which

  • 0

I have an entity framework Complex Type(Activity) I have mapped to a SP which returns records of data.

class Activity
string viewed
string registered

I need to create another another EF entity (complex type?) that will hold metadata about this object and as well as the object data – a List, but I don’t know how to make this association(List).

class ActivityData
string totalrecords
string pages
List records

I would need to serialize this Activity class to a webget response in json. Similar to this:

[WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
public Activity GetActivity(string total_records, string sql_params)
{
    List<activity> activityList;
    using (ModelEntities context = new ModelEntities())
    {
        resultList = context.CallSP();
    }
    ActivityData data = new ActivityData();
    data.totalrecords = 10;
    data.pages = 5;
    activity.records = List<activity>;

    return activity;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T10:53:38+00:00Added an answer on May 29, 2026 at 10:53 am

    You have Few problems:

    • Complex types cannot participate in relations. So you cannot have complex type which has navigation property to set of other complex types or entities as well as you cannot have entity which has navigation property to set of complex types.
    • Stored procedures are not able to populate relations.

    Both your Activity and AcitivityData must be mapped entities (that usually mean they must be either tables or views in database) and you must use Linq if you want to load activities and their data in single database roundtrip.

    You will also have use serialization attributes to ensure that your relations are serializable to JSON.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a complex model class, of which only a few string columns should
I have complex-type object of entity framework. I would like buid dynamically select and
I have Entity Framework entities Events which have an EntityCollection of RSVP. I want
I have an Entity Framework data model. Part of the model is a Customer
I have imported a stored procedure that returns a dataset into my Entity Framework.
I have a stored procedure that I've mapped in my entity framework model (trying
I have create a restful service which returning a List an entity type: [AspNetCompatibilityRequirements(RequirementsMode
I have a project with ASP.NET MVC, using Entity Framework to get data from
I have a Entity Framework data mode that I insert to it some stored
We have an entity framework model with has some inheritance in it. The following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.