W
W
winstan2016-06-19 11:28:31
MySQL
winstan, 2016-06-19 11:28:31

MySQL NHibernate how to use composite indicator?

I have such a table
c4926409456f404194791cb8ba4517f4.jpg
. I try to map it like this .., you can’t change it (table).

using FluentNHibernate.Mapping;
using Sourcedb.Entities;
 
namespace Sourcedb.Mapping
{
    public class OptionsMap : ClassMap<Options>
    {
        public OptionsMap()
        {
            Table("s_options");
            
            CompositeId()
                .KeyProperty(x => x.Productid, "product_id")
                .KeyProperty(x => x.Fiature, "feature_id")
                .KeyProperty(x => x.Val, "value");
        }
    }
}

But I get a crash at startup, I can’t understand what he doesn’t like and how to fix it?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question