Example #1
0
 public Party(DomainParty domainParty)
 {
     Id              = domainParty.Id;
     CustomerId      = domainParty.CustomerId;
     PartySize       = domainParty.PartySize;
     CreatedDateTime = domainParty.CreatedDateTime;
     IsNotified      = domainParty.IsNotified;
     IsActive        = domainParty.IsActive;
 }
Example #2
0
        private static bool ValidateNotifyRequest(DomainParty party, JsonPatchDocument <DomainParty> patchDoc)
        {
            var notifyPath      = DomainParty.PropNameToPatchPath[nameof(DomainParty.IsNotified)];
            var notifyRequest   = patchDoc.Operations.SingleOrDefault(o => o.path.Equals(notifyPath));
            var isNotifyRequest = notifyRequest != null;

            if (!isNotifyRequest)
            {
                return(false);
            }

            var requestedIsNotified = Convert.ToBoolean(notifyRequest.value);

            if (requestedIsNotified == party.IsNotified)
            {
                patchDoc.Operations.Remove(notifyRequest);
                return(false);
            }

            return(true);
        }