fluent

Fluent NHibernate (1.2.0.712) export mappings to HBM not working / not respecting conventions

孤街醉人 提交于 2019-12-01 11:06:10
The HBM export function in Fluent NHibernate does not seem to work. If I call FluentMappingsContainer.ExportTo, the generated mappings come out incorrect, and I get the following exception: FluentNHibernate.Cfg.FluentConfigurationException: An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail. My configuration code looks like this: MsSqlConfiguration database = MsSqlConfiguration.MsSql2008 .ConnectionString(GetConnectionString()) .Cache(c => c .UseQueryCache() .UseSecondLevelCache() .ProviderClass

BaseFoo cannot be inherited with different arguments: <T,X.Bar<T>> and <T,X.Foo<T>>

走远了吗. 提交于 2019-12-01 10:26:14
This is a simplified version of Java inherited Fluent method return type in multiple level hierarchies . Given the following code: public enum X { ; static interface BaseFoo<T, S extends BaseFoo<T, S>> { S foo(); } static interface Foo<T> extends BaseFoo<T, Foo<T>> { void foo1(); } static interface BaseBar<T, S extends BaseBar<T, S>> extends BaseFoo<T, S> { S bar(); } static interface Bar<T> extends BaseBar<T, Bar<T>>, Foo<T> { void bar1(); } } run javac X.java I get the error message: X.java:15: error: BaseFoo cannot be inherited with different arguments: <T,X.Bar<T>> and <T,X.Foo<T>> static

FluentNHibernate mapping for Dictionary

巧了我就是萌 提交于 2019-12-01 09:25:34
What is the best way of mapping a simple Dictionary property using Fluent NHibernate? dbones To map a list as a dictionary: HasMany(x => x.Customers) .AsMap(); I have not used it; so cannot give an example. Have look at the wiki: Cached version of the page , Actual page I have given the cached version of the page as the site seems to be down. Craig Russell public class PersistedData { public virtual IDictionary<key, value> Dictionary { get; set; } } public class PersistedDataMap : ClassMap<PersistedData> { HasMany(x => x.Dictionary) .Table("dict_table") .KeyColumn("column_id") .AsMap<string>(

Is it possible to elegantly configure Serilog with if-statements?

谁都会走 提交于 2019-12-01 08:38:28
My Serilog configuration code looks like this: Log.Logger = new LoggerConfiguration() .Enrich.WithExceptionDetails() .Enrich.FromLogContext() .MinimumLevel.Warning() // .MinimumLevel.Override("Microsoft", LogEventLevel.Verbose) // .MinimumLevel.Override("System", LogEventLevel.Verbose) // .MinimumLevel.Override("Microsoft.AspNetCore.Authentication", LogEventLevel.Verbose) .WriteTo.Console( outputTemplate: "[{Timestamp:HH:mm:ss} {Level}] {SourceContext}{NewLine}{Message:lj}{NewLine}{Exception}{NewLine}", theme: AnsiConsoleTheme.Literate ) // .WriteTo.File() .CreateLogger(); I'd like to change

BaseFoo cannot be inherited with different arguments: <T,X.Bar<T>> and <T,X.Foo<T>>

风流意气都作罢 提交于 2019-12-01 07:54:49
问题 This is a simplified version of Java inherited Fluent method return type in multiple level hierarchies. Given the following code: public enum X { ; static interface BaseFoo<T, S extends BaseFoo<T, S>> { S foo(); } static interface Foo<T> extends BaseFoo<T, Foo<T>> { void foo1(); } static interface BaseBar<T, S extends BaseBar<T, S>> extends BaseFoo<T, S> { S bar(); } static interface Bar<T> extends BaseBar<T, Bar<T>>, Foo<T> { void bar1(); } } run javac X.java I get the error message: X.java

FluentNHibernate mapping for Dictionary

亡梦爱人 提交于 2019-12-01 07:27:28
问题 What is the best way of mapping a simple Dictionary property using Fluent NHibernate? 回答1: To map a list as a dictionary: HasMany(x => x.Customers) .AsMap(); I have not used it; so cannot give an example. Have look at the wiki: Cached version of the page, Actual page I have given the cached version of the page as the site seems to be down. 回答2: public class PersistedData { public virtual IDictionary<key, value> Dictionary { get; set; } } public class PersistedDataMap : ClassMap<PersistedData>

Is it possible to elegantly configure Serilog with if-statements?

白昼怎懂夜的黑 提交于 2019-12-01 07:07:38
问题 My Serilog configuration code looks like this: Log.Logger = new LoggerConfiguration() .Enrich.WithExceptionDetails() .Enrich.FromLogContext() .MinimumLevel.Warning() // .MinimumLevel.Override("Microsoft", LogEventLevel.Verbose) // .MinimumLevel.Override("System", LogEventLevel.Verbose) // .MinimumLevel.Override("Microsoft.AspNetCore.Authentication", LogEventLevel.Verbose) .WriteTo.Console( outputTemplate: "[{Timestamp:HH:mm:ss} {Level}] {SourceContext}{NewLine}{Message:lj}{NewLine}{Exception}

Fluent NHibernate does not create IN part of WHERE clause

只谈情不闲聊 提交于 2019-12-01 05:47:37
I have Fluent NHibernate Linq queries where I check values based on run time arrays. A basic example would be something like: var array = [1,2,3,4,5,6]; using (var session = SessionProvider.SessionFactory.OpenSession()) { return session.Query<MyObject>().Where(x => array.Contains(x.CompareVal)).ToList(); } I would expect the generated SQL statement to look something like this: SELECT CompareVal, Column1, Column2 FROM MyObject WHERE CompareVal IN (1,2,3,4,5,6) However, what I'm finding instead is that the generated SQL statement simply emits the WHERE clause (proven by watching in Profiler) and

Parallel Fluent UDF on Linux OS

风格不统一 提交于 2019-11-30 16:44:41
/*--> */ /*--> */ Parallel UDF on Linux OS Table of Contents 1. Parallel UDF on Linux OS 1.1. Steps 1.1.1. Setup the Directory structure 1.1.2. Build the UDF Library 1.1.3. Load the UDF Library and hook UDF to specified BCs using a script (job.jou) 1.1.4. submitting your job on HPC 1.2. udf.c – UDF code for 2nd stokes wave 1.3. Reference 1 Parallel UDF on Linux OS Platform: centOS Goal: imposing user defined 2nd stokes wave on velocity inlet BC 1.1 Steps Edit source code Setup the Directory structure Build the UDF library Load the UDF Library Load and Hood the UDF to specified BCs in journal

Fluent NHibernate Many to one mapping

风格不统一 提交于 2019-11-30 14:53:59
I am new to Hibernate world. It may be a silly question, but I am not able to solve it. I am testing many to One relationship of tables and trying to insert record. I have a Department table and Employee table. Employee and Dept has many to One relationship here. I am using Fluent NHibernate to add records. All codes below. Pls help SQL Code create table Dept ( Id int primary key identity, DeptName varchar(20), DeptLocation varchar(20) ); create table Employee ( Id int primary key identity, EmpName varchar(20), EmpAge int, DeptId int references Dept(Id) ); Class Files public partial class Dept