Skip to content

Business Rules #3775

Answered by Luka803
Luka803 asked this question in Questions
Apr 4, 2024 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

If someone would have same problem, it cannot go like i did with UOW. You must go via IDataPortal of the object which will return list of the objects from the database or it's just my soultion.

 private class NameAlreadyExist : BusinessRuleAsync
 {
     public NameAlreadyExist(IPropertyInfo property) : base(property)
     {
         ProvideTargetWhenAsync = true;
         IsAsync = true;
         InputProperties = new List<IPropertyInfo> { PrimaryProperty };
     }
     protected override async Task ExecuteAsync(IRuleContext context)
     {
         var service = context.ApplicationContext.GetRequiredService<IDataPortal<AccountList>>();
         string input = (string)context.InputPropert…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@Luka803
Comment options

@Luka803
Comment options

Answer selected by Luka803
@StefanOssendorf
Comment options

@Luka803
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants