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>Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
How about the Service layer and the DTO ?
can i have some example ?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Well, how do you want to use it?
var account = new BankAccount(); // Insert and SaveChanges var user = account.CreatorUser;Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
thanks i think my problem has been solved
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
thanks for your feedback ;)
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
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?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Why would there be a new way? That's already simple and minimal.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)