Page 1 of 1

Entity Class + FluentNHibernate Map Class in the same FILE

Posted: Fri 20 Jul 2012 13:10
by risegabriel
Hello, I was trying to modify my NHibernate Template to generate the Entity Class and the Fluent Map Class in the same file. But I'm too stupid to do that LoL

So... what i'm attempting to do is generate a single file with this structure
I'm using C# BTW

file.cs

using blablabla; // all the external files needed


namespace My.Super.Namespace
{

public partial class EntityClass
{
//My NHibernate Template Generated Class
}

public class EntityClassMap : ClassMap<EntityClass>
{
//My FluentNHibernate MAP Template Generated Class
}

}


There's a good soul whoo could help me?
If there is already a template like this... can someone pass me the link?

Thanks in advance

Re: Entity Class + FluentNHibernate Map Class in the same FILE

Posted: Thu 26 Jul 2012 17:42
by Shalex
risegabriel wrote:I was trying to modify my NHibernate Template to generate the Entity Class and the Fluent Map Class in the same file.
We do not recommend you to implement such approach because EntityClass in your sample represents application's component layer (does not include database-specific mapping), but EntityClassMap is like data-access layer which can be modified independently from EntityClass.

If it is critical for your task, please contact us and we will help you to merge the NHibernate and Fluent NHibernate templates to set their output in the same file.

Re: Entity Class + FluentNHibernate Map Class in the same FILE

Posted: Wed 01 Aug 2012 11:55
by Shalex
We have sent a merged template (EntityClasses+FluentMapping) to your e-mail address.

Re: Entity Class + FluentNHibernate Map Class in the same FILE

Posted: Wed 08 Aug 2012 13:48
by risegabriel
Can you send me the template again?
I believe didn't receive the e-mail with the code =/

Re: Entity Class + FluentNHibernate Map Class in the same FILE

Posted: Thu 09 Aug 2012 11:57
by risegabriel
Thanks I've received the template BUT when I click on the generate code button I get the following messages:



An error occurred during an attempt to compile the template 'EntityClasses+FluentMapping'.
Error List:
error : The best overloaded method match for 'EntityDeveloper.TemplateEngine.Output.AddReference(string)' has some invalid arguments
error : Argument 1: cannot convert from 'System.Reflection.AssemblyName' to 'string'
error : The best overloaded method match for 'EntityDeveloper.TemplateEngine.Output.AddReference(string)' has some invalid arguments
error : Argument 1: cannot convert from 'System.Reflection.AssemblyName' to 'string'
error : The best overloaded method match for 'EntityDeveloper.TemplateEngine.Output.AddReference(string)' has some invalid arguments
error : Argument 1: cannot convert from 'System.Reflection.AssemblyName' to 'string'
error : The best overloaded method match for 'EntityDeveloper.TemplateEngine.Output.AddReference(string)' has some invalid arguments
error : Argument 1: cannot convert from 'System.Reflection.AssemblyName' to 'string'
error : The best overloaded method match for 'EntityDeveloper.TemplateEngine.Output.AddReference(string)' has some invalid arguments
error : Argument 1: cannot convert from 'System.Reflection.AssemblyName' to 'string'
error : The best overloaded method match for 'EntityDeveloper.TemplateEngine.Output.AddReference(string)' has some invalid arguments
error : Argument 1: cannot convert from 'System.Reflection.AssemblyName' to 'string'
error : 'System.Linq.ParallelEnumerable.Where<TSource>(System.Linq.ParallelQuery<TSource>, System.Func<TSource,int,bool>)' is a 'method', which is not valid in the given context

Re: Entity Class + FluentNHibernate Map Class in the same FILE

Posted: Fri 10 Aug 2012 11:40
by Shalex
We have sent you two templates with the same functionality:
- EntityClasses+FluentMapping_CurrentBuild.zip works with the previous (4.5.222) build of Entity Developer
- EntityClasses+FluentMapping_NextBuild.zip should be used with the current (4.5.240) build. This caused by some changes in our object model

1. Specify the build number (x.xx.xxx) of your Entity Developer.
2. Which one template (from *_CurrentBuild.zip or *_NextBuild.zip) are you using?