public void Configure(EntityTypeBuilder <Financier> entity) { entity.ToTable("Financiers", schema: "Finance"); entity.HasKey(e => e.Id); entity.Property(p => p.Id).HasColumnType("UNIQUEIDENTIFIER").HasColumnName("FinancierId"); entity.Property(p => p.FinancierName) .HasConversion(p => p.Value, p => OrganizationName.Create(p)) .HasColumnType("NVARCHAR(50)") .HasColumnName("FinancierName") .IsRequired(); entity.Property(p => p.Telephone) .HasConversion(p => p.Value, p => PhoneNumber.Create(p)) .HasColumnType("NVARCHAR(14)") .HasColumnName("Telephone") .IsRequired(); entity.Property(p => p.IsActive) .HasConversion(p => p.Value, p => IsActive.Create(p)) .HasColumnType("BIT") .HasColumnName("IsActive") .IsRequired(); entity.Property(p => p.UserId) .HasColumnType("UNIQUEIDENTIFIER") .HasColumnName("UserId") .IsRequired(); entity.Property(e => e.CreatedDate) .HasColumnType("datetime2(7)") .ValueGeneratedOnAdd() .HasDefaultValueSql("sysdatetime()"); entity.Property(e => e.LastModifiedDate).HasColumnType("datetime2(7)"); }
protected override EntityName ParseNode(XmlNode node, XmlToModelResult xmlToModelResult) { OrganizationName result = new OrganizationName(); XmlNodeList childNodes = node.ChildNodes; foreach (XmlNode childNode in new XmlNodeListIterable(childNodes)) { if (childNode.NodeType == System.Xml.XmlNodeType.Text) { string value = childNode.Value; result.AddNamePart(new EntityNamePart(value)); } else { if (childNode is XmlElement) { XmlElement element = (XmlElement)childNode; string name = NodeUtil.GetLocalOrTagName(element); string value = GetTextValue(element, xmlToModelResult); result.AddNamePart(new EntityNamePart(value, GetOrganizationNamePartType(name))); } } } return(result); }
private Custodian CreateCustodian() { EntityNamePart namePart = new EntityNamePart("Community Health and Hospitals"); OrganizationName name = new OrganizationName(); name.AddNamePart(namePart); CustodianOrganization organization = new CustodianOrganization(); organization.Id.Add(new Identifier("2.16.840.1.113883.4.6", "99999999")); organization.Name = name; organization.Telecom = CreateTelecom("555-555-1002", Ca.Infoway.Messagebuilder.Domainvalue.Basic.TelecommunicationAddressUse.WORKPLACE); organization.Addr = CreateAddress("1002 Healthcare Drive", "Portland", "OR", "99123", "US"); AssignedCustodian assignedCustodian = new AssignedCustodian(); assignedCustodian.RepresentedCustodianOrganization = organization; Custodian custodian = new Custodian(); custodian.AssignedCustodian = assignedCustodian; return(custodian); }
protected override Organization Parse() { return(new Organization { Id = ToInt(OrganizationID), Name = OrganizationName.ToString(), About = About.ToString(), LastUpdate = ToDateTime(LastUpdate), Address = CompleteAddress.ToString(), StreetName = StreetName.ToString(), StreetNumber = ToInt(StreetNo), Barangay = Barangay.ToString(), City = CityOrMunicipality.ToString(), State = StateOrProvince.ToString(), Country = Country.ToString(), DateEstablished = DateEstablished.ToString(), ParentOrganization = ParentOrganization.ToString(), Preacher = FeastBuilderOrPreacher.ToString(), Branch = BranchOrLocation.ToString(), ContactNumber = ContactNo.ToString(), Email = EmailAddress.ToString(), Website = Website.ToString(), Longitude = (float)Convert.ToDouble(Longitude), Latitude = (float)Convert.ToDouble(Latitude), RetreatSchedule = RetreatSchedule.ToString(), RecollectionSchedule = RecollectionSchedule.ToString(), TalkSchedule = TalkSchedule.ToString(), CampSchedule = CampSchedule.ToString(), VolunteerSchedule = VolunteerSchedule.ToString(), OrgMasking = MaskingData.ToString() }); }
public override int GetHashCode() { var hashCode = ServerAddress.GetHashCode() ^ OrganizationName.GetHashCode() ^ EndpointType.GetHashCode(); // ReSharper disable once NonReadonlyMemberInGetHashCode if (Credentials != null) { if (EndpointType == AuthenticationProviderType.ActiveDirectory) { return(hashCode ^ Credentials.Windows.ClientCredential.UserName.GetHashCode() ^ Credentials.Windows.ClientCredential.Domain.GetHashCode()); } if (EndpointType == AuthenticationProviderType.LiveId) { return(hashCode ^ Credentials.UserName.UserName.GetHashCode() ^ DeviceCredentials.UserName.UserName.GetHashCode() ^ DeviceCredentials.UserName.Password.GetHashCode()); } return(hashCode ^ Credentials.UserName.UserName.GetHashCode()); } return(hashCode); }
public static NotificationConfig CreateNotificationConfig( string organizationId, string notificationConfigId, string projectId, string topicName) { OrganizationName orgName = new OrganizationName(organizationId); TopicName pubsubTopic = new TopicName(projectId, topicName); SecurityCenterClient client = SecurityCenterClient.Create(); CreateNotificationConfigRequest request = new CreateNotificationConfigRequest { ParentAsOrganizationName = orgName, ConfigId = notificationConfigId, NotificationConfig = new NotificationConfig { Description = ".Net notification config", PubsubTopicAsTopicName = pubsubTopic, StreamingConfig = new NotificationConfig.Types.StreamingConfig { Filter = "state = \"ACTIVE\"" } } }; NotificationConfig response = client.CreateNotificationConfig(request); Console.WriteLine($"Notification config was created: {response}"); return(response); }
public virtual void TestParseNoWeirdParts() { XmlNode node = CreateNode("<something>Organization name</something>"); OrganizationName organizationName = (OrganizationName) new OnElementParser().Parse(CreateContext(), node, null).BareValue; Assert.AreEqual(1, organizationName.Parts.Count, "number of name parts"); AssertNamePartAsExpected("name", organizationName.Parts[0], null, "Organization name"); }
public override Organization ToOutFormat() { var orgName = new OrganizationName(_input.Name); var orgAddress = new Address(_input.Street, _input.StreetExtended, _input.PostalCode, _input.City, _input.Country); var orgVatNumber = new VatNumber(_input.VatNumber); var organization = new Organization(_input.Id, orgName, orgAddress, orgVatNumber, _input.Website, new List <OrganizationMember>(), _input.ChangeDate, _input.ChangedBy); return(organization); }
private Financier GetFinancier() => new Financier ( new ExternalAgent(Guid.NewGuid(), AgentType.Financier), OrganizationName.Create("First Bank and Trust"), PhoneNumber.Create("555-555-5555"), IsActive.Create(true), new Guid("660bb318-649e-470d-9d2b-693bfb0b2744") );
public void NewInstance_String_Success(string organizationName) { //Arrange //Act var name = new OrganizationName(organizationName); //Assert name.Name.Should().Be(organizationName); }
public virtual void TestFormatValueOrganizationName() { EnPropertyFormatter formatter = new EnPropertyFormatter(); OrganizationName name = new OrganizationName(); name.AddNamePart(new EntityNamePart("prefix", OrganizationNamePartType.PREFIX)); name.AddNamePart(new EntityNamePart("Organization")); Assert.AreEqual("<x xsi:type=\"ON\"><prefix>prefix</prefix>Organization</x>", formatter.Format(GetContext("x"), new ENImpl <EntityName>(name)).Trim(), "OrganizationName uses ON formatter"); }
public virtual void TestFormatValueNonNull() { OnPropertyFormatter formatter = new OnPropertyFormatter(); OrganizationName organizationName = new OrganizationName(); organizationName.AddNamePart(new EntityNamePart("Organization")); string result = formatter.Format(GetContext("name"), new ONImpl(organizationName)); Assert.AreEqual("<name>Organization</name>", result.Trim(), "something in text node"); }
/// <summary> /// Serves as a hash function for a particular type. /// </summary> /// <returns> /// A hash code for the current <see cref="T:System.Object"/>. /// </returns> /// <filterpriority>2</filterpriority> public override int GetHashCode() { unchecked { int result = (Phone != null ? Phone.GetHashCode() : 0); result = (result * 397) ^ (OrganizationName != null ? OrganizationName.GetHashCode() : 0); result = (result * 397) ^ (OrganizationTaggedDataElement != null ? OrganizationTaggedDataElement.GetHashCode() : 0); return(result); } }
public virtual void TestParseEmptyNode() { XmlNode node = CreateNode("<something/>"); ON on = (ON) new OnElementParser().Parse(CreateContext(), node, null); OrganizationName organizationName = on.Value; Assert.IsNotNull(organizationName, "OrganizationName"); Assert.AreEqual(0, organizationName.Parts.Count, "number of name parts"); Assert.AreEqual(0, organizationName.Uses.Count, "number of name uses"); }
public override int GetHashCode() { unchecked { var hashCode = (ProjectName != null ? ProjectName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (OrganizationName != null ? OrganizationName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ LinesOfCode; hashCode = (hashCode * 397) ^ OpenIssueCount; return(hashCode); } }
/// <summary>Snippet for GetOrganization</summary> public void GetOrganizationResourceNames() { // Snippet: GetOrganization(OrganizationName, CallSettings) // Create client OrganizationsClient organizationsClient = OrganizationsClient.Create(); // Initialize request argument(s) OrganizationName name = OrganizationName.FromOrganization("[ORGANIZATION]"); // Make the request Organization response = organizationsClient.GetOrganization(name); // End snippet }
public virtual void TestFormatValueNonNull() { EnR2PropertyFormatter formatter = new EnR2PropertyFormatter(); OrganizationName organizationName = new OrganizationName(); organizationName.AddNamePart(new EntityNamePart("Organization")); string result = formatter.Format(GetContext("name", "ON"), new ONImpl(organizationName)); Assert.IsTrue(this.result.IsValid()); AssertXml("something in text node", "<name>Organization</name>", result, true); }
public virtual void TestFormatValueReservedXmlChars() { OnPropertyFormatter formatter = new OnPropertyFormatter(); OrganizationName organizationName = new OrganizationName(); organizationName.AddNamePart(new EntityNamePart("<cats think they're > humans & dogs 99% of the time/>")); string result = formatter.Format(GetContext("name"), new ONImpl(organizationName)); Assert.AreEqual("<name><cats think they're > humans & dogs 99% of the time/></name>".Trim(), result.Trim (), "something in text node"); }
public virtual void TestParseAllWithLsQualifier() { XmlNode node = CreateNode("<name>" + " <prefix qualifier=\"LS\">IncCo</prefix>" + "</name>"); OrganizationName orgName = (OrganizationName) new OnR2ElementParser().Parse(CreateContext(), node, this.xmlResult).BareValue; Assert.IsTrue(this.xmlResult.IsValid()); Assert.IsTrue(orgName.Uses.IsEmpty()); Assert.AreEqual(1, orgName.Parts.Count, "number of name parts"); AssertNamePartAsExpected("prefix", orgName.Parts[0], OrganizationNamePartType.PREFIX, "IncCo"); Assert.AreEqual(orgName.Parts[0].Qualifier.CodeValue, "LS"); }
public Organization(Guid id, OrganizationName orgName, Address orgAddress, VatNumber orgVatNumber, string website, List <OrganizationMember> members, DateTime changeDate, string changedBy) { Id = new OrganizationId(id); Name = orgName; Address = orgAddress; VatNumber = orgVatNumber; Website = website; Members = members; ChangeDate = changeDate; ChangedBy = changedBy; }
public Organization(Guid id, string name, string street, string streetExtended, string postalNumber, string city, string country, string vatNumber, string website, List <OrganizationMember> members, DateTime changeDate, string changedBy) { Id = new OrganizationId(id); Name = new OrganizationName(name); Address = new Address(street, streetExtended, postalNumber, city, country); VatNumber = new VatNumber(vatNumber); Website = website; Members = members; ChangeDate = changeDate; ChangedBy = changedBy; }
/// <summary> /// Overloaded so that the returned User object can be from the same context that a reference is being saved to /// </summary> public User GetUser(IObjectRepository repo) { if (!IsAuthenticated) { return(null); } string userName = GetPrincipal().Identity.Name.ToLower(); string orgName = OrganizationName.ToLower(); return(repo.Users.SingleOrDefault(y => y.UserName.ToLower() == userName && y.Organization.Name.ToLower() == orgName)); }
public virtual void TestFormatValueReservedXmlChars() { EnR2PropertyFormatter formatter = new EnR2PropertyFormatter(); OrganizationName organizationName = new OrganizationName(); organizationName.AddNamePart(new EntityNamePart("<cats think they're > humans & dogs 99% of the time/>")); string result = formatter.Format(GetContext("name", "ON"), new ONImpl(organizationName)); Assert.IsTrue(this.result.IsValid()); AssertXml("something in text node", "<name><cats think they're > humans & dogs 99% of the time/></name>" , result, true); }
/// <summary>Snippet for CreateAlertPolicy</summary> public void CreateAlertPolicyResourceNames2() { // Snippet: CreateAlertPolicy(OrganizationName, AlertPolicy, CallSettings) // Create client AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.Create(); // Initialize request argument(s) OrganizationName name = OrganizationName.FromOrganization("[ORGANIZATION]"); AlertPolicy alertPolicy = new AlertPolicy(); // Make the request AlertPolicy response = alertPolicyServiceClient.CreateAlertPolicy(name, alertPolicy); // End snippet }
/// <summary>Snippet for CreateContact</summary> public void CreateContactResourceNames3() { // Snippet: CreateContact(OrganizationName, Contact, CallSettings) // Create client EssentialContactsServiceClient essentialContactsServiceClient = EssentialContactsServiceClient.Create(); // Initialize request argument(s) OrganizationName parent = OrganizationName.FromOrganization("[ORGANIZATION]"); Contact contact = new Contact(); // Make the request Contact response = essentialContactsServiceClient.CreateContact(parent, contact); // End snippet }
public virtual void TestParseAll() { XmlNode node = CreateNode("<something><prefix>prefix 1</prefix>Organization name<delimiter>,</delimiter><suffix>Inc</suffix></something>" ); OrganizationName organizationName = (OrganizationName) new OnElementParser().Parse(CreateContext(), node, null).BareValue; Assert.AreEqual(0, organizationName.Uses.Count, "number of name uses"); Assert.AreEqual(4, organizationName.Parts.Count, "number of name parts"); AssertNamePartAsExpected("prefix prefix 1", organizationName.Parts[0], OrganizationNamePartType.PREFIX, "prefix 1"); AssertNamePartAsExpected("name", organizationName.Parts[1], null, "Organization name"); AssertNamePartAsExpected("delimiter comma", organizationName.Parts[2], OrganizationNamePartType.DELIMITER, ","); AssertNamePartAsExpected("suffix Inc", organizationName.Parts[3], OrganizationNamePartType.SUFFIX, "Inc"); }
public static PagedEnumerable <ListNotificationConfigsResponse, NotificationConfig> ListNotificationConfigs(string organizationId) { OrganizationName orgName = new OrganizationName(organizationId); SecurityCenterClient client = SecurityCenterClient.Create(); PagedEnumerable <ListNotificationConfigsResponse, NotificationConfig> notificationConfigs = client.ListNotificationConfigs(orgName); // Print Notification Configuration names. foreach (var config in notificationConfigs) { Console.WriteLine(config.NotificationConfigName); } return(notificationConfigs); }
public virtual void TestOrganizationNameEquals() { OrganizationName orgName1 = new OrganizationName(); orgName1.AddUse(Ca.Infoway.Messagebuilder.Domainvalue.Basic.EntityNameUse.LEGAL); orgName1.AddNamePart(new EntityNamePart("aName", OrganizationNamePartType.PREFIX, Ca.Infoway.Messagebuilder.Domainvalue.Basic.EntityNamePartQualifier .LEGALSTATUS)); OrganizationName orgName2 = new OrganizationName(); orgName2.AddUse(Ca.Infoway.Messagebuilder.Domainvalue.Basic.EntityNameUse.LEGAL); orgName2.AddNamePart(new EntityNamePart("aName", OrganizationNamePartType.PREFIX, Ca.Infoway.Messagebuilder.Domainvalue.Basic.EntityNamePartQualifier .LEGALSTATUS)); Assert.AreEqual(orgName1, orgName2); }
public void ShouldRaiseError_NewFinancier_WithNullExternalAgent() { Assert.Throws <ArgumentNullException>(() => { Financier financier = new Financier ( null, OrganizationName.Create("First Bank and Trust"), PhoneNumber.Create("555-555-5555"), IsActive.Create(true), new Guid("660bb318-649e-470d-9d2b-693bfb0b2744") ); }); }
public virtual void TestFormatValueNonNullMultipleNameParts() { OnPropertyFormatter formatter = new OnPropertyFormatter(); OrganizationName organizationName = new OrganizationName(); organizationName.AddNamePart(new EntityNamePart("prefix", OrganizationNamePartType.PREFIX)); organizationName.AddNamePart(new EntityNamePart("Organization")); organizationName.AddNamePart(new EntityNamePart(",", OrganizationNamePartType.DELIMITER)); organizationName.AddNamePart(new EntityNamePart("Inc", OrganizationNamePartType.SUFFIX)); string result = formatter.Format(GetContext("name"), new ONImpl(organizationName)); Assert.AreEqual("<name><prefix>prefix</prefix>Organization<delimiter>,</delimiter><suffix>Inc</suffix></name>", result.Trim (), "something in text node with goofy sub nodes"); }