Base solution for your next web application
Open Closed

Repository returns DynamicProxy instead of my object #7029


0
uabel created

Hello, I have the problem that I get a DynamicProxy instead of my object from the Repository. What can be the problem here? I'll get it later problems with mapping because of the _entityWrapper.

The object and the repo looks exactly like all entities. I can not find a mistake here.

Return of workflowRepository.Get(input.Workflow.Id); looks like this:

Object looks like this: `public class Workflow : Entity, IHasCreationTime, IHasModificationTime { [ForeignKey("StateId")] public virtual State State { get; set; } public int StateId { get; set; }

    [ForeignKey("ProductId")]
    public virtual Product Product { get; set; }
    public int ProductId { get; set; }

    public bool Default { get; set; }
    public bool Active { get; set; } // Aktiv ja, nein, wenn Active aber nicht SendMail müssen die Anhänge trotzdem erstellt werden
    public bool SendMail { get; set; }
    public bool AutoSend { get; set; }

    public bool SendMailToCustomer { get; set; }
    public string SendMailToBcc { get; set; }

    [JsonIgnore]
    public List<WorkflowI18N> WorkflowI18Ns { get; set; }

    [IgnoreDataMember]
    [JsonIgnore]
    public List<Template> Attachments { get; set; }

 

    public DateTime CreationTime { get; set; }
    public DateTime? LastModificationTime { get; set; }

}`


Gruss
Uwe

1 Answer(s)
  • 0
    ryancyq created
    Support Team

    Hi, it could be due to your virtual Product Product

    See https://docs.microsoft.com/en-us/ef/ef6/fundamentals/proxies