mappings

fluent nhibernate - Many to Many relationship with attribute on relationship

大兔子大兔子 提交于 2019-12-25 02:14:09
问题 I have my code working, but I'm getting 2 extra columns in the table/ddl, to represent a Many to Many relationship, ~~but~~ with attributes (scalars) on the relationship. I am using 1.2.0.712 (FluentNHibernate.dll) 3.1.0.4000 (NHibernate.dll) Entities: public partial class Employee { public Employee() { CommonConstructor(); } private void CommonConstructor() { this.MyEmployeeToJobTitleMatchLinks = new List<EmployeeToJobTitleMatchLink>(); } public virtual Guid? EmployeeUUID { get; set; }

Generic mapping with Automapper

て烟熏妆下的殇ゞ 提交于 2019-12-13 05:23:41
问题 I would like to create a generic/common mapping that will be the equivalent of the following mappings but with single line. cfg.CreateMap<int?, PropertyModel<int?>>().ConvertUsing<ValueToPropertyModelConverter<int?>>(); cfg.CreateMap<double?, PropertyModel<double?>>().ConvertUsing<ValueToPropertyModelConverter<double?>>(); cfg.CreateMap<string, PropertyModel<string>>().ConvertUsing<ValueToPropertyModelConverter<string>>(); I would imagine something like cfg.CreateMap<TValue, PropertyModel

Fluent NHibernate? Am I doing this correctly?

一笑奈何 提交于 2019-12-12 06:15:20
问题 I am new to using Fluent NHibernate and NHibernate for the first time. I've used a custom written mapper since about 2000 that was written in house. Made a switch to LinqToSQL about 2 years ago, and about 6 months ago to Entities. I'd like to see what Fluent/NHibernate have to offer. However, I can't seem to get it to run correctly. The following is a copy of my classes, their references, the ClassMaps. Can someone tell me if this simple implementation is correct? This is my mappings and

LINQ to NHibernate can't get to children's children

别来无恙 提交于 2019-12-11 08:05:03
问题 I have entity A which has an IList of B called Bs and B has an IList of C called Cs. I want to search for all A's which have at least 5 C's in them. So I went and wrote using (var s = this._sessionFactory.OpenSession()) { IQueryable<A> q = s.Linq<A>(); // some code... if (range.Min.HasValue) q = q.Where(a => a.Bs.Sum(b => b.Cs.Count) >= range.Min.Value); // some code... return q.Select(b=>b).ToArray(); } However upon executing the code (and having Min specified in the range variable) I get

railo application.cfc this.mappings not working

自古美人都是妖i 提交于 2019-12-04 01:42:57
问题 i am using the latest version of railo, and am trying to get the per-application mappings to work. this is what i am doing: <cfcomponent name="MyApp"> <cfset THIS.Name = "MyApp"> <cfset THIS.Mappings["/myapp"] = ExpandPath(".")> </cfcomponent> so, i am trying to be able to access components within this application folder through a myapp.* mappings rather than having to to rootapp.myapp.* (from what i understand, this component setup should then work. however, my components cannot be accessed