Hi all
On Domain layer, my entity is subclass of FullAuditedEntity
May i know how can i retrieve the CreatorUser object on Service layer?
Please advise. Thanks alot
[Table("BankAccount")]
public class BankAccount : FullAuditedEntity
{
public string AccountNo { get; set; }
public string AccountName { get; set; }
public string BankName { get; set; }
}
7 Answer(s)
-
0
You need to inherit FullAuditedEntity<TPrimaryKey, User>:
public class BankAccount : FullAuditedEntity<int, User>
-
0
How about the Service layer and the DTO ?
can i have some example ?
-
0
Well, how do you want to use it?
var account = new BankAccount(); // Insert and SaveChanges var user = account.CreatorUser;
-
0
thanks i think my problem has been solved
-
0
thanks for your feedback ;)
-
0
how do you get the CreatorUser in a DTO?
like i have a list of articles that I want to display, with the name of the creator next to each article.
I have an ArticleDto that is used from the applicationservice:
Article = ObjectMapper.Map<ArticleDto>(o)
it used to be easy (maybe it still is) by adding a common CreatorUserDto to the ArticleDto and the CreatorUserDto looked like this:
[AutoMapFrom(typeof(User))] public class CreatorUserDto { public virtual string UserName { get; set; } } }
but i guess there is a new way of doing this?
-
0
Why would there be a new way? That's already simple and minimal.