I have a class like this:
public class AuthEntity
{
public int Id { get; set; }
public AuthResource Resource { get; set; }
public int ActionId { get; set; }
}
where AuthResource is:
public class AuthResource
{
public long ResourceId { get; private set; }
public int ResourceType { get; private set; }
}
The table where the data is stored has the following fields:
- Id
- ResourceId
- ResourceType
- ActionId
I can read the AuthEntity well (including Resource property) but I don't know how do I insert AuthEntity records. NPoco says that there is no Resource field. How can I map the nested object fields to the table fields?
Thanks