none
Is it possible to create an entity that is not mapped to a table in the database? RRS feed

  • Question

  • Is it possible to create an entity that is not mapped to a table in the database?

    Background:

    I created an entity (A) with 5 properties (name, phone, email, date, comment).

    I queried the other tables in my model using linq and convert the result to a list of type (A) so on my view I can type A.name

    IList<A> results = new IList<A>();

    results = (from m in B where m.Id < 10 select m.name, m.email, m.date, m.phone, m.comment)

    return View(results)

    Friday, March 15, 2013 3:24 PM

Answers

  • Hi,

    If you are using edmx diagrams, you could create a complex type, just pressing right button on model:

    Add > Complex Type

    Regards,

    JA Reyes,


    Please remember to Vote & "Mark As Answer" if this post is helpful to you.
    Por favor, recuerda Votar y "Marcar como respuesta" si la solución de esta pregunta te ha sido útil.

    • Marked as answer by kjmcsd.net Friday, March 15, 2013 7:05 PM
    Friday, March 15, 2013 3:36 PM