Questions tagged [fluent]

Fluent interface is an API which allows method chaining to make code more readable.

Fluent interface is API which allows method chaining to make code more readable.

1148 questions
0
votes
1 answer

Foreign Key with Fluent Entity Framework

I have created a News Model. My News have an author which is of the Member Class. is this enough for the foreing key to be set? HasRequired(n => n.Author); Code: public class Member : Identity { public string FirstName { get; set; } …
Poul K. Sørensen
  • 16,950
  • 21
  • 126
  • 283
0
votes
1 answer

MVC 4 explicitly load a many to many EF lookup and filter by both keys

I have the following in an MVC4 app. I want to filter the load by both keys, there could be many to many but both the keys together represent a unique row. The goal to to explicitly load these collections only when needed and filter by both sides…
Marc
  • 1,178
  • 1
  • 18
  • 31
0
votes
1 answer

Session.Clear & Session.Merge Issues

In my application i need to work with detached objects and have already implemented the reporitory pattern. the problems show up in the following code sample: var shops = ShopRepository.GetAll(); //Session.Clear() called inside, CacheMode…
Alex
  • 84
  • 6
0
votes
1 answer

"..references a null or transient value." (Bad design?) - at least one of two columns must not be null

A Brand has an Image (logo - not nullable). A Product has many Images. An Image must have either a Brand or a Product, but I can't use "not nullable" on either field because an image only belongs to one of them? How would you map this kind of…
Kiada
  • 679
  • 3
  • 15
  • 24
0
votes
2 answers

A product has one price, a price has one product - hasone nhibernate relationship?

I was a little miffed about the one-to-one relationship explanation on the 'I Think You Mean A Many To One' article. In this instance for example, a product has one price because the business in question is small, niche, localized and supports only…
Kiada
  • 679
  • 3
  • 15
  • 24
0
votes
1 answer

EF4 One to many to one with Db foreign key

I am trying to use code first with an existing db. So far it went well, but now I am failing at a one to many to one relationship. There is a table customer and a table address in the db where address does NOT have any customerid but a foreign one…
user1029883
  • 695
  • 7
  • 21
0
votes
1 answer

Fluent NHibernate - How to customize "left join" condition?

Is there a way to add and customize some LEFT JOIN conditions? I need it to be generated like the next native SQL (Oracle query): LEFT JOIN TableB B ON SomeStoredProc(MainTable.ColumnA || MainTable.ColumnB) = B.TableB_Key LEFT JOIN TableC C ON…
Zarathustra
  • 115
  • 2
  • 8
0
votes
1 answer

Fluent Nhibernate will not save

I have the following classes: public class PhoneModel { public virtual ModelIdentifier SupportModels } public class ModelIdentifier { public virtual string Name public virtual IList Values } This is how i mapped it: …
0
votes
1 answer

.NET Fluent code design best practices

Today I tried to make some fluent interface for my OpenXml Spreadsheet Cell. And I wrote this one: http://pastebin.com/64dZ8ji7 This could be used as: var newCell = _cell.For.Column(1).For.Row(1).WithContent("Hello").Create(); My question is in…
Akim Khalilov
  • 1,019
  • 4
  • 16
  • 31
0
votes
1 answer

Images are not displayed on the buttons

I use the Fluent Ribbon (fluent.codeplex.com). I want to arrange four buttons side by side. I use the following code:
David
  • 4,027
  • 10
  • 50
  • 102
0
votes
2 answers

Strange Unhandled Exception error in Laravel

I am trying to retrieve some values from a table, but got the Unhandled exception: Trying to get property of non-object error when trying to access the results as a property of the object returned by Fluent. Problem: Trying to access the property of…
Nyxynyx
  • 61,411
  • 155
  • 482
  • 830
0
votes
1 answer

How to properly map entities using Fluent API?

I have two entities, a User and a UserProfile. The PK of User is UserId, the PK of UserProfile is UserProfileId. Every time a new user is created in my app, I create a new UserProfile whose PK is the same as the PK in User. When I then try to go…
BBauer42
  • 3,549
  • 10
  • 44
  • 81
0
votes
1 answer

Error using Join on uniqueidentifier - convert uniqueidentifier to numeric

I am using Fluent NHibernate on sqlserverce. Using NHibernate QueryOver I try to retrieve a row - NHibernate generate automatically a a join query and I get the following Exception: [SQL: SELECT tag FROM CheckpointToProtectionGroup cp2pg …
Haimon
  • 227
  • 1
  • 14
0
votes
2 answers

set default value for enum in fluent nhibernate mapping

I have a mapping like this. public class MyObjectMap : ClassMap { public MyObjectMap() { Component(_ => _.MyItem, key => { key.Map(x => x.MyItemValue).Column("COL"); /** I want to set this value to a particular enum in this…
Jim
  • 14,952
  • 15
  • 80
  • 167
0
votes
1 answer

Segment violation issue with UDF (C code) writtern for CFD solver Fluent

User Defined Function (UDFs) are functions that one can program and can be dynamically loaded along with the CFD Software Fluent Solver to enhance the standard features. UDFs are written in C programming Language. Following is a section of my…
momba
  • 185
  • 1
  • 2
  • 8