none
can i use a dynamic class as ef core database model RRS feed

  • Question

  • hi,

    can I use a dynamic class that has been created while runtime to be used as an ef core database model? Is it a safe approach to do such thing?



    Monday, May 27, 2019 6:28 PM

All replies

  • hi,

    can I us a dynamic class that has been created while runtime to be used as an ef core database model? Is it a safe approach to do such thing?


    You shouldn't think of EF Core as some kind of panacea solution, becuase it's not. It's an Object Relational  Model solution that uses a virtual object model, a persistence model,  based on concrete types.

    If you want to return dynamic objects, then consider what is being talked about in the link.

    http://lvasquez.github.io/2013/08/15/return-dynamic-result-from-database-asp-mvc/

    Monday, May 27, 2019 8:36 PM
  • With EF Core, data access is performed using a model. A model is made up of entity classes and a context object that represents a session with the database.

    You should look into using Dapper if you want to use dynamic types. But you will still need a database to query against.


    william xifaras


    Tuesday, May 28, 2019 2:41 PM