1

I have entity SampleObject with following properties

SampleObject.cs
    Guid Id {get; set;}
    string Name {get; set;}
    IList<string> Images {get; set;}

I tried to map these ImagePathUrls property like these

Map(x => x.Images, ("ImagePathUrl")).Length(255);

Ofcourse on database side I have table with column ImagePathUrl of type nvarchar 255.

On debugging I getting following error

Could not determine type for: System.Collections.Generic.IList`1
[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b77a5c561934e089]], mscorlib, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b77a5c561934e089, for columns: NHibernate.Mapping.Column(ImagePathUrl)

1 Answer 1

1

You are mapping List to string column.

HasMany(x => x.Images).WithKeyColumn("SampleObjectId").WithTableName("SampleObjectImages").AsElemen‌​t("ImagePathUrl");
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.