fluent-nhibernate

Mapping a list of Enums

。_饼干妹妹 提交于 2020-01-13 14:06:23
问题 I have a table called UserPermissions with a FK to the users table by userId and then a string column for the string value of an enum. The error I am seeing is NHibernate.MappingException: An association from the table UserPermissions refers to an unmapped class: GotRoleplay.Core.Domain.Model.Permission My Permission Enum: public enum Permission { [StringValue("Add User")] AddUser, [StringValue("Edit User")] EditUser, [StringValue("Delete User")] DeleteUser, [StringValue("Add Content")]

Fluent NHibernate Visual Designer [closed]

北城余情 提交于 2020-01-13 10:22:11
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . Is there a visual designer similar to Mindscape's NHibernate designer for Fluent NHibernate? I have decided to move from EF4 to NH3, but without a visual design interface it is going to be a hard sell to my team who are used to the EF4 model creation interface. 回答1: I've only heard of Mindscape's NHibernate

Fluent NHibernate Visual Designer [closed]

风流意气都作罢 提交于 2020-01-13 10:22:05
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . Is there a visual designer similar to Mindscape's NHibernate designer for Fluent NHibernate? I have decided to move from EF4 to NH3, but without a visual design interface it is going to be a hard sell to my team who are used to the EF4 model creation interface. 回答1: I've only heard of Mindscape's NHibernate

Struggling to Comprehend nHibernate SchemaUpdate, even with Blog Posts

Deadly 提交于 2020-01-12 05:30:29
问题 I've seen the various blog posts concerning nHibernate's SchemaUpdate , and even Ayende's very good example, and downloaded the samples, but for some reason I cannot get the same same thing to work for me. I will note that I am using Fluent NHibernate , but from what I can tell that should not make too huge a difference. Update I have reached the point where the SchemaUpdate runs, but it is just a full schema creation, no 'altering'. In otherwords, it's the same as if I just built the

Install NHibernate 3.2 with NuGet

☆樱花仙子☆ 提交于 2020-01-11 19:56:22
问题 I'm new to NHibernate and have been trying to get up and running with it, Fluent NHibernate and NHProf using NuGet. After reading this article (http://gurustop.net/blog/2011/03/13/nhibernate-3-1-0-on-nuget-important-details) it seems that v3.1 shouldn't be directly installed, however, there appears no such warning for v3.2. After successfully installing NHibernate 3.2 and NHProf using NuGet, I'm unable to install Fluent NHibernate as it says it's "Already referencing a newer version of

How can the NamedSQLQueryDefinition class be used dynamically as a sql-query equivalent?

倖福魔咒の 提交于 2020-01-11 11:59:07
问题 I need to dynamically add named queries to the NHibernate configuration object. The search engines return few hits referencing NamedSQLQueryDefinition or NamedQueryDefinition. Below is what I'm attempting to do. I don't know what to provide to the NamedSQLQueryDefinition constructor to successfully create a query. Can anyone provide a sample of how to create a new NamedSQLQueryDefinition the right way? Thanks!! Session initializer: private static ISessionFactory CreateSessionFactory() { var

Injecting ISession Into My Repositories Using Structuremap in a Asp.Net MVC Application

感情迁移 提交于 2020-01-10 15:40:13
问题 My repositories all take ISession in the constructor: protected Repository(ISession session) { this.session = session; } private readonly ISession session; In an Asp.Net MVC application, using StructureMap, how would I go about setting up ISession in my the StructureMap Registry? Would I need to to add SessionFactory to the container also? Does FluentNHibernate change things? 回答1: You should register ISession using a factory method. Another options (not always the best, but easy to use) is to

How do I get fluent nhibernate to create a varbinary(max) field in sql server

和自甴很熟 提交于 2020-01-09 07:53:03
问题 How can I get fluent nhibernate to create a varbinary field in a sql server 2005 table that uses a field size of varbinary(max)? At the moment I always get a default of varbinary(8000), which isn't big enough as i'm going to be storing image files. I've tried using CAstle.ActiveRecord but havent had any success yet. [ActiveRecord] public class MyFile : Entity { public virtual string FileName { get; set; } public virtual string FileType { get; set; } public virtual int FileVersion { get; set;

Fluent NHibernate Many-to-many mapping with auto-generated pk instead of composite key

£可爱£侵袭症+ 提交于 2020-01-07 05:10:11
问题 I'm working on a RoleProvider in .NET, using Fluent NHibernate to map tables in an Oracle 9.2 database. The problem is that the many-to-many table connecting users and roles uses a primary key generated from a sequence, as opposed to a composite key. I can't really change this, because I'm writing it to be implemented in a larger existing system. Here is my UserMap: public UserMap() { this.Table("USR"); HasMany(x => x.Memberships).Cascade.All() .Table("MEMBERSHIP").Inverse().LazyLoad();

Flunet Nhibernate all-delete-orphan not working like expected

随声附和 提交于 2020-01-06 10:43:53
问题 I have following domain classes: public class News: EntityBase { public virtual DateTime CreationDate { get; set; } public virtual IList<DomainNameToNews> DomainNameToNews { get; set; } public News() { DomainNameToNews=new List<DomainNameToNews>(); } } public class DomainNameToNews : EntityBase { public virtual DomainName DomainName { get; set; } public virtual News News { get; set; } } Mapping: public class NewsMap : ClassMap<News> { public NewsMap() { Id(x => x.Id).GeneratedBy.Identity();