コード例 #1
0
        private SampleEmployee CreateNewPerson(UpnIdentifier identifier)
        {
            EmployeeIdIdentifier id = new EmployeeIdIdentifier(DateTime.UtcNow.Ticks.ToString());

            var emp = new SampleEmployee(id, identifier);

            emp.Properties["compensation"] = "$100,000";
            emp.Properties["startdate"]    = "2-May-2008";

            if (identifier.IdentifierType.Matches(_secondaryIdentifierType))
            {
                Logger?.Debug($"Setting upn: {identifier}");

                emp.Upn = new UpnIdentifier(identifier.StringValue);
            }

            return(emp);
        }
コード例 #2
0
        private AuditResult CheckUser(SampleEmployee person, IAudience audience, JSchema schema)
        {
            IList <ValidationError> errors = new List <ValidationError>();

            var userToCheck = person.ToJson();

            //var schema = audience.Schema.GetProviderSpecificSchema(this.Name);

            bool valid = userToCheck.IsValid(schema, out errors);

            // map these to our own error object
            var auditErrors = new List <AuditError>();

            foreach (var error in errors)
            {
                auditErrors.Add(new AuditError(error, audience, this, schema));
            }

            var result = new AuditResult(person, auditErrors);

            return(result);
        }