コード例 #1
0
        public string Get(string setting)
        {
            if (setting == "init")
            {
                _repository.RemoveAllUserDetails();
                var name = _repository.CreateDatabaseAndIndex();

                _repository.AddUserDetail(new UserProfileModel()
                {
                    Email       = "*****@*****.**",
                    DateOfBirth = "27/08/1987",
                    UserId      = 100,
                    UserName    = "******",
                    Address     = new Address {
                        AddressLine1 = "Address line 1 for hello",
                        AddressLine2 = "Address Line 2 for hello",
                        City         = "Petrboro",
                        PostCode     = "PE7 8GW"
                    }
                });
                _repository.AddUserDetail(new UserProfileModel()
                {
                    Email       = "*****@*****.**",
                    DateOfBirth = "27/08/1987",
                    UserId      = 101,
                    UserName    = "******",
                    Address     = new Address {
                        AddressLine1 = "Address line 1 for hello2",
                        AddressLine2 = "Address Line 2 for hello2",
                        City         = "Petrboro",
                        PostCode     = "PE7 8GW"
                    }
                });
                _repository.AddUserDetail(new UserProfileModel()
                {
                    Email       = "*****@*****.**",
                    DateOfBirth = "27/03/1981",
                    UserId      = 101,
                    UserName    = "******",
                    Address     = new Address {
                        AddressLine1 = "10 Carolside Grove",
                        AddressLine2 = "Hampton Gardens",
                        City         = "Peterborough",
                        PostCode     = "PE7 8QF"
                    }
                });

                return("Collections added");
            }

            return("Unknown");
        }
コード例 #2
0
 public void Post([FromBody] UserProfileModel userDetail)
 {
     _userDetailsRepository.AddUserDetail(userDetail);
 }