fluent

SharpArchitecture / Fluent NHibernate

送分小仙女□ 提交于 2020-01-05 07:08:41
问题 Does DomainSignature attribute create unique constrain in DB? Does Fluent NHibernate 1.1.0.685 supports NaturalId correctly? 回答1: Domain signature doesn't create constraints in DB. Yes Fluent NH supports Natural ID by map.NaturalId() .Property(x => x.Name) .Property(x => x.NickName); syntax 来源: https://stackoverflow.com/questions/4489576/sharparchitecture-fluent-nhibernate

Using fluent interface with builder pattern

谁都会走 提交于 2020-01-05 03:50:07
问题 I'm trying to understand fluent builder pattern by creating the person builder object below. I've written the code as I would like to use it but am having issues with implementing it. My issues are as follows: When calling HavingJob() , this should create a new job that can then be configured using only applicable methods for a job and ultimately added to the Jobs collection of the person. It feels like should return it so that other fluent job methods can be called on it. Not sure how to

Fluent Validation and libraries

馋奶兔 提交于 2020-01-03 11:37:30
问题 While looking for something totally different the other day, I have stumbled upon two libraries for doing Fluent Validation in .NET. The concept seems interesting since so far I am doing my validations using the usual conditional and branching statements (if, else, case, etc). In particularly, it makes relatively easy to chain some conditions which could result in some cases in shorter code for complex conditions, and to embed several error messages for each violations in the same object.

Getting error “Association references unmapped class” when using interfaces in model

丶灬走出姿态 提交于 2020-01-03 05:43:04
问题 I'm trying to use the automap functionality in fluent to generate a DDL for the following model and program, but somehow I keep getting the error "Association references unmapped class: IRole" when I call the GenerateSchemaCreationScript method in NHibernate. When I replace the type of the ILists with the implementation of the interfaces (User and Role) everything works fine. What am I doing wrong here? How can I make fluent use the implemented versions of IUser and IRole as defined in Unity?

Fluent NHibernate Inheritance mapping type

£可爱£侵袭症+ 提交于 2020-01-03 01:58:07
问题 I'm new to Fluent NHibernate, thus far I managed to get my mapping working except for the inheritance part. Is there anybody who could help me finish the mapping? I have simplified the code as much as possible. Thank you! My database: CREATE TABLE [User] ( UserID INT NOT NULL IDENTITY(1,1), Type CHAR(1) NOT NULL, Email VARCHAR(255) NOT NULL, PRIMARY KEY(UserID) ); CREATE TABLE [Student] ( UserID INT NOT NULL, Firstname VARCHAR(255) NOT NULL, PRIMARY KEY(UserID), FOREIGN KEY(UserID) REFERENCES

Fluent NHibernate: Prevent class from being mapped

限于喜欢 提交于 2020-01-02 05:38:09
问题 I am sure it is a piece of cake, but I can't find it using google. I need to EXCLUDE a single class from mapping. My current configuration is: return Fluently.Configure() .Database(MsSqlConfiguration.MsSql2005.ConnectionString(c => c.Is(@"Data Source=PC\SQLEXPRESS;......"))) .Mappings(m => m.AutoMappings.Add( AutoPersistenceModel.MapEntitiesFromAssemblyOf<Person2>() .Where(t => t.Namespace == "ExampleData.HumansTest") .UseOverridesFromAssemblyOf<PersonMappingOverrides>() .ConventionDiscovery

Fluent NHibernate fetching view without unique identifier

前提是你 提交于 2020-01-02 01:09:32
问题 I'm trying to map a view without an identifier, but nhibernate still generates a sql with the id column (giving me a sql error, since the ID column does not exists in the db). Maybe I'm misunderstanding the Id() constructor? constructor comments: Create an Id that doesn't have a corresponding property in the domain object, or a column in the database. This is mainly for use with read-only access and/or views. Defaults to an int identity with an "increment" generator. public class

laravel migration re-organising column order

五迷三道 提交于 2019-12-31 17:51:16
问题 When you create a new column in a table you can use the ->after('column name') to dictate where it goes. How can I create a migration that re-orders the columns in the right order I want? 回答1: Try this, hope it help you to find right solution: public function up() { DB::statement("ALTER TABLE example MODIFY COLUMN foo DATE AFTER bar"); } public function down() { DB::statement("ALTER TABLE example MODIFY COLUMN foo DATE AFTER bar"); } 回答2: If you want to do it without destroying data, you

How to map composite-id with fluent nhibernate using an interface?

安稳与你 提交于 2019-12-31 02:08:08
问题 I'm trying to switch out .hbm mappings to fluent mappings and have a problem with the mapping of composite-ids and the usage of Interfaces the Class looks as follows: public class ClassWithCompositeId { public virtual IKeyOne KeyOne { get; set; } public virtual IKeyTwo KeyTwo { get; set; } } our hbm mapping looks like this: <hibernate-mapping ...> <class name="ClassWithCompositeId" table="t_classwithcompositeid"> <composite-id> <key-many-to-one name="KeyOne" column="colkeyone" class="company

2020即将到来,DevExpress WPF界面开发还有哪些功能值得期待?

江枫思渺然 提交于 2019-12-30 11:07:50
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 下载DevExpress v19.2完整版 通过 DevExpress WPF Controls ,您能创建有着强大互动功能的XAML基础应用程序,这些应用程序专注于当代客户的需求和构建未来新一代支持触摸的解决方案。 又到了每年发布DevExpress WPF产品线2020年非正式计划的时候了,关于DevExpress WPF 2020年您有哪些功能上的期待?欢迎在文章末尾留下您的建议,即将发布的新版可能有您想要拥有的功能哦~ WPF Pivot Grid 全新的过滤器面板 在为Data Grid和TreeList控件实现新的过滤器面板后,Pivot Grid也将启用它。全新的过滤器面板将为每个列包含带有单独过滤器的标记(而不是将整个筛选器字符串显示为纯文本)。 自定义表单搜索 Pivot Grid的自定义表单将显示一个搜索框,允许最终用户筛选可用字段的列表。 摘要过滤器弹出窗口 数据字段 标题将显示一个过滤器按钮,该按钮将调用一个弹出窗口,允许最终用户配置摘要过滤器。 摘要类型和组间隔的上下文菜单 全新的上下文菜单项允许最终用户在运行时更改摘要类型和组间隔。 WPF Data Editors 增强日期导航器 技术团队希望能够重写日期导航器可视化的部分,以便它可自定义和更轻便,同事还将介绍以下功能: 支持触摸