title: Entity Framework - map stored procedure function import to existing object
body: <p>I have a class library with objects defined that I will use in an application.  In a seperate class library I have my Entity Framework object model, where I add a function import, select my stored procedure, and generate a complex type.  Rather than generate a complex type, is there any way to point it to the object I defined in my other class library?  Essentially, I want my objects all in a seperate library than my data access layer.  Do I need to write my own mapping logic?</p>
  
  <p>Note, this is my first EF attempts.  I guess you could say I am using a code first approach.  I am building the objects (POCO) I want to use and they are in their own class library (My object model).  In a seperate class library I am using EF and exposing methods that accept or return classes in my object model, that can be called by my appliation (data access layer).</p>
  
  <p>In my database I have a set of stored procedures.  Stored procedures are the only way my data access layer can interact with the database.</p>
  
  <p>In my data access layer, I have created an edmx file, and add function imports to the edmx file.  The edmx entity container access is set to internal, so it isn't exposed outside of the class library. Instead, I have a public class with public methods that can be called by my application.  Those methods make calles to the object context class to fire the storedproceds, and return objects from my object model.  The purpose here is that I am only using the entity framework to handle stored procedure calls.  In essence the data access technology is completely hidden from the application.  The application only knows how to call specific functions exposed from my data access library, and deal with objects exposed in my object model.  Obviously I could write code that translates complex types defined in the edmx to types in my object model,  but I'm just wondering if there is any way to avoid writing that code myself, and just have EF use my object model instead of its complex types...</p>