Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ComplexType #18

Open
sazahiri opened this issue Oct 8, 2022 · 0 comments
Open

ComplexType #18

sazahiri opened this issue Oct 8, 2022 · 0 comments

Comments

@sazahiri
Copy link

sazahiri commented Oct 8, 2022

Hi

I used [ComplexType] according to the sample case, but when I use the create method for insert data to database I got the below exception.

[Table("Person")]
   public abstract class PersonNode
   {
       public string Name { get; set; }

       public int Born { get; set; }

       [JsonProperty(PropertyName = "NewAddressName")]
       public virtual Address Address { get; set; }
   }
[ComplexType]
    public class Address
    {
        public string AddressLine { get; set; }

        public string City { get; set; }

        public string State { get; set; }

        public string Country { get; set; }
    }
  public static ActorNode Actor = new ActorNode<int>
        {
            Name = "Ellen Pompeo",
            Born = 1969,
            Address = new AddressWithComplexType
            {
                City = "Los Angeles",
                State = "California",
                Country = "US",
                Location = new Location
                {
                    Latitude = 34.0522,
                    Longitude = -118.2437
                }
            }
        };

  var query = _client.Cypher.Create(p => 
                p.Pattern<ActorNode>("a").Prop(() => actor));
            query.ExecuteWithoutResultsAsync().Wait();
Property values can only be of primitive types or arrays thereof. Encountered: Map{Country -> String("US"), City -> String("Los Angeles"), State -> String("California")}.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant