Skip to content
Discussion options

You must be logged in to vote

When you say "all existing objects" do you mean in memory (like in a collection) or are you referring to a key value in a database?

Assuming it is a key value in a database, then yes, a business rule can make use of a command object, and that's a good way to solve the problem. Another is to create a ReadOnlyBase subclass that returns a boolean result (and that's what'd I would probably do).

Something like this (untested code):

using System;
using System.Threading.Tasks;
using Csla;
using Csla.Rules;

namespace WpfApp1
{
  [Serializable]
  public class PersonEdit : BusinessBase<PersonEdit>
  {
    public static readonly PropertyInfo<int> IdProperty = RegisterProperty<int>(nameof(Id));
    p…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tjscurr
Comment options

Answer selected by tjscurr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants