Esempio n. 1
0
        public void AddNewPCEdge(string inPersonID, string inCompanyID)
        {
            var proxyPerson  = new PersonEntity(inPersonID);
            var proxyCompany = new CompanyEntity(inCompanyID);

            if (Persons.ContainsKey(inPersonID))
            {
                Persons.TryGetValue(inPersonID, out proxyPerson);
            }
            else
            {
                Persons.Add(inPersonID, proxyPerson);
            }

            if (Companies.ContainsKey(inCompanyID))
            {
                Companies.TryGetValue(inCompanyID, out proxyCompany);
            }
            else
            {
                Companies.Add(inCompanyID, proxyCompany);
            }

            proxyPerson.AddCompany(inCompanyID);
            proxyCompany.AddPerson(inPersonID);
        }
Esempio n. 2
0
        public CompanyEntity GetCompanyByID(string inID)
        {
            var proxy = new CompanyEntity(inID);

            if (Companies.TryGetValue(inID, out proxy))
            {
                return(proxy);
            }
            else
            {
                throw new System.ArgumentException("Can't find requested element", "original");
            }
        }