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
22
votes
4 answers

Fluent NHibernate Many-to-Many

I am using Fluent NHibernate and having some issues getting a many to many relationship setup with one of my classes. It's probably a stupid mistake but I've been stuck for a little bit trying to get it working. Anyways, I have a couple classes that…
Ryan Lanciaux
  • 5,965
  • 2
  • 37
  • 49
21
votes
5 answers

Is this Monster Builder a good Builder / Factory pattern for abstracting long constructors mixed with setters?

This is a human interface question about combining the step builder pattern with the enhanced or wizard builder patterns into a creational DSL. It uses a fluent like interface, although it uses method chaining, not cascading. That is, the methods…
candied_orange
  • 7,036
  • 2
  • 28
  • 62
21
votes
2 answers

How to join table in fluent nhibernate

how do we do this mapping but fluently?
CurlyFro
  • 1,862
  • 4
  • 22
  • 39
20
votes
1 answer

Fluent NHibernate Cascade - Which side?

In using Fluent NHibernate, I can't seem to find a good explanation of when you use the cascading option on the References side vs. the HasMany side. What's the difference (if any) in mapping the…
Adam
  • 335
  • 1
  • 3
  • 8
18
votes
11 answers

What fluent interfaces have you made or seen in C# that were very valuable? What was so great about them?

"Fluent interfaces" is a fairly hot topic these days. C# 3.0 has some nice features (particularly extension methods) that help you make them. FYI, a fluent API means that each method call returns something useful, often the same object you called…
Charlie Flowers
  • 17,338
  • 10
  • 71
  • 88
17
votes
1 answer

Builder pattern with nested objects

Hi I'm stuck with a problem. I want to implement the builder pattern to make creating my objects easier. The problem I face has to do with nested object. The object I would like to create has a list of other objects in it, and I don't really have an…
16
votes
10 answers

distinct() with pagination() in laravel 5.2 not working

I'm trying to use distinct() with pagination() in laravel 5.2 with fluent and it's given result proper but pagination remain same(Like without apply distinct). I have already reviewed and tested below answers with mine code - laravel 5 - paginate…
AddWeb Solution Pvt Ltd
  • 21,025
  • 5
  • 26
  • 57
15
votes
7 answers

Is there any library to represent SQL queries as objects in Java code?

I was wondering if there is any library that can be used to represent SQL queries as objects in Java. In the code I have plenty of static variables of type java.lang.String that are hand written SQL queries. I would be looking for library having a…
Tomasz Błachowicz
  • 5,731
  • 9
  • 41
  • 47
15
votes
5 answers

Must a "fluent" (or chainable) method be immutable?

Say I have a class with some properties and some methods for manipulating those properties: public class PersonModel { public string Name { get; set; } public string PrimaryPhoneNumber { get; set; } public void…
user718642
15
votes
3 answers

Is there a fluent assertion API for MSTest?

I've recently been exposed to the fluent interface in nUnit and I love it; however, I am using msTest. Does anyone know if there is a fluent interface that is either testing framework agnostic or for msTest?
JoshBerke
  • 66,142
  • 25
  • 126
  • 164
14
votes
3 answers

Is there any Fluent NHibernate book?

Taking into consideration that Fluent NHibernate has been available for some time I thought that there would be a book available already so i search in amazon and in google but there is no books for fluent nhiberanet. Am i right or book already…
senzacionale
  • 20,448
  • 67
  • 204
  • 316
14
votes
4 answers

How to mass insert or update in a single query (not a for loop of queries) using Laravel 4.2

$cardQueryList = []; foreach($cards as $cardName => $quantity) { $cardQueryList[] = [ 'username' => $user->username, 'card_uid' => $card->uid, 'have_quantity' => $quantity …
Howard
  • 3,648
  • 13
  • 58
  • 86
14
votes
2 answers

Fluent converters/mappers with Json.NET?

So, I got a bunch of classes I need to serialize/deserialize which also happen to be domain objects (at least some of 'em), thus I want them to be free of any attributes or not depending on a certain framework. I looked at Custom Converters in…
xvdiff
  • 2,179
  • 2
  • 24
  • 47
14
votes
1 answer

Get content and status code from HttpResponse

I am using apache's HttpClient (via the Fluent API). When I get the response object back, I first do: response.returnResponse().getStatusLine().getStatusCode() If status code is 4xx or 5xx, I throw an exception, or I return the…
Sayak Banerjee
  • 1,954
  • 3
  • 25
  • 58
13
votes
2 answers

Fluent NHibernate Generated AND Assigned ID Columns

I'm using Fluent NHibernate for my data-persistence in a web application. My problem... I have a base class that maps all entities with an ID property of type T (almost always an int or GUID) using GeneratedBy().Identity() On application start-up, I…
Adam
  • 335
  • 1
  • 3
  • 8
1
2
3
76 77