Search code examples
c#entity-frameworkpocovalueinjecter

ValueInjector with Dynamic Proxy objects


I have the standard repository pattern with a service layer and I need to map a POCO object called Game:

public class Game
{    
    public int Id { get; set; }
    public int GameTypeId { get; set; }
    public int GameStateId { get; set; }
    public int? PreviousGameId { get; set; }
    public DateTime EndOn { get; set; }
    public DateTime StartOn { get; set; }
}

to map it to a view model that has a member called GameId. So Id > GameId.

However when I create my mapping convention the object is coming in with what looks like a GUID attached to the end of it.

How can I get value injector to map these POCO objects properly without mapping from the dynamic proxy to a POCO.. or is that not possible?


Solution

  • I ended up turning off proxy generation and lazy loading and now I just eagar load everything