Base solution for your next web application
Open Closed

Reference to ABPUser ?!! #1143


User avatar
0
mrvithan created

How to reference to ABp User object from Entity class ?

For example,

[ForeignKey("ApproveManagerId")]
public virtual User ApproveManager {get;set;}

[Required]
 public virtual int      ApproveManagerId    { get; set;

I have tried this way but compile with error.

Please advise.

Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

5 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    This is the right way actually. What is the compile error you are getting ?

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    mrvithan created

    User class is not defined .... seems that i don't know its namespace.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    hikalkan created
    Support Team

    If you are using module-zero and created template from aspnetboilerplate.com, then your project should contain a User class. Can you search it?

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    mrvithan created

    Nope. I try to reference to AbpUser<TTenant, TUser>, but still no luck

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    mrvithan created

    Ok i can see how already. Thx.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)