0

I’m using Entity framework 4.1. Fluent API to map my model to pre-defined database. Is there any way to use eager initialization of complex properties via stored procedures or user defined functions? For example:

public class Car
{
    public int Id { get; set; }
    public string Name { get; set; }
    public string Description { get; set; }
    public Model Model {get;set}
    public int Year {get;set;}
    public ICollection<Part> Parts { get; set; }
}

Let’s say I have a user defined function in the database that takes Car Id as an input and returns list of parts. Is there any chance to make EF using it?

Thanks.

Bashir Magomedov
  • 2,841
  • 4
  • 28
  • 44

1 Answers1

0

Have a look at How to: Call a User-Defined Function

Stefan P.
  • 9,489
  • 6
  • 29
  • 43