コード例 #1
0
        public Person AddPerson(string name, string socialMediaLink, string iconUrl, bool isTrending = false,
                                string firstName        = null, string lastName      = null, string level              = null, string site     = null,
                                string twitterName      = null, string position      = null, string district           = null, string gemeente = null,
                                string postalCode       = null, Gender?gender        = null, Organisation organisation = null,
                                Subplatform subplatform = null, DateTime?dateOfBirth = null, byte[] image              = null)
        {
            InitNonExistingRepo();
            Person person = new Person
            {
                Name            = name,
                SocialMediaLink = socialMediaLink,
                IconURL         = iconUrl,
                TrendingScore   = 0,
                IsTrending      = isTrending,
                FirstName       = firstName,
                LastName        = lastName,
                Level           = level,
                Site            = site,
                TwitterName     = twitterName,
                Position        = position,
                District        = district,
                Gemeente        = gemeente,
                Postalcode      = position,
                Gender          = gender ?? Gender.OTHERS,
                Organisation    = organisation,
                SubPlatforms    = subplatform is null ? new List <Subplatform>() : new List <Subplatform> {
                    subplatform
                },
                DateOfBirth        = dateOfBirth ?? new DateTime(1970, 01, 01),
                Elements           = new List <Element>(),
                SubscribedProfiles = new List <Profile>(),
                Alerts             = new List <Alert>(),
                Keywords           = new List <Keyword>(),
                Records            = new List <Record>(),
                Image = image
            };

            if (subplatform != null)
            {
                person.SubPlatforms.Add(subplatform);
                subplatform.Items.Add(person);
            }

            person = ItemRepo.CreatePerson(person);
            UowManager.Save();
            return(person);
        }