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

Entity Framework referencing columns in foreign key differs from number of referenced columns

I'm using Entity Framework code first, and I'm trying to get my migrations/database working (using the -update-database command), but I keep getting this error: System.Data.SqlClient.SqlException (0x80131904): Number of referencing columns in…
0
votes
2 answers

How can I map 2 non-hierarchical classes to the same table with a defining column & value in Entity Framework?

So there is a way to map 2 hierarchical classes in EF to the same table with a defining column and value (http://msdn.microsoft.com/en-us/data/jj591617.aspx#2.4). I am wondering if there's a way to map 2 non-hierarchical classes to the same table in…
Moismyname
  • 472
  • 1
  • 6
  • 17
0
votes
2 answers

Nested Select Query Refactoring and translating to Eloquent / Query Builder

Step 1: Get the maximum set_id from the table. set_id is not unique. select max(set_id) from mytable where ver = 6; # assume returns 3 Step 2: Get the results from the table where set_id is max: select * from mytable where ver = 6 and set_id = 3; #…
Gravy
  • 12,264
  • 26
  • 124
  • 193
0
votes
1 answer

Proxy is created, and interceptor is in the __interceptors array, but the interceptor is never called

This is the first time I've used interceptors with the fluent registration and I'm missing something. With the following registration, I can resolve an IProcessingStep, and it's a proxy class and the interceptor is in the __interceptors array, but…
0
votes
2 answers

Chainning Rules on Fluent Validation

I'm already using the latest version of Fluent Validation which is 5.4.0.0; What I need to achieve is: Think on a Vehicle VIN, which depends upon Make Id, Model Id and Year of manufacture. Does in Fluent I have the ability to execute a Rule based on…
gandarez
  • 2,609
  • 4
  • 34
  • 47
0
votes
1 answer

Fluent nHibernate and mapping IDictionary> how to?

I have problem with making mapping of classes with propert of type Dictionary and value in it of type Dictionary too, like this: public class Class1 { public virtual int Id { get; set; } public virtual IDictionary
szkra
  • 1,423
  • 2
  • 14
  • 21
0
votes
1 answer

Fluent Query Builder Getting Bind Variables in Wrong Order?

Been scratching my head over some queries not coming back with all the rows they should be, and I believe the reason is the bind variables not being ordered correctly. Is this a fluent bug, or am I doing something very wrong? Here is an example,…
Jason
  • 4,411
  • 7
  • 40
  • 53
0
votes
2 answers

How to overcome the C# limitation to overload on generic constraint?

Let's have the following code (type-safe stubs for jQuery): public interface IjQueryPromise { } public interface IjQueryPromise : IjQueryPromise { } public static class jQueryPromiseEx { public static T Done(this T t, params…
TN.
  • 18,874
  • 30
  • 99
  • 157
0
votes
1 answer

Relation 3 tables Laravel

I have 3 tables : playlists id | secret | [...] 1 xjdjd 2 dzfze playlists_songs id | playlist_id | song_id | [...] 1 1 83 2 1 32 songs id | name | [...] 22 I want fetch all songs of a playlist. Right now my…
Jeremie Ges
  • 2,747
  • 3
  • 22
  • 37
0
votes
1 answer

Put SearchDescriptor into a separate variable and use it within a MultiSearch query

I'd like to separate my SearchDescriptor from my MultiSearch query to allow for easy reusability. This is what I have now(before separation). It works perfect: IMultiSearchResponse result = esClient .MultiSearch(search => search …
Brandon
  • 1,058
  • 1
  • 18
  • 42
0
votes
1 answer

Add a field to a relation table and access row values through code

Using EF code first and Fluent, I've created two tables containing data and a third table which is the "relation table" (not sure what the 'official' word for it is?). Each row holds Id's from both tables and defines a many-to-many relation between…
Ivo Coumans
  • 759
  • 8
  • 23
0
votes
0 answers

Laravel includes hidden attributes in json using DB class

I have declared some hidden fields in model to prevent them from getting included in json output. Eloquent is working fine. But I have to build queries based on url parameters , So I am using DB class for it. But It returns all the fields of…
brajmohan
  • 153
  • 1
  • 8
0
votes
1 answer

How do I map a table were primary key and identifier is not the same column?

I have to access a legacy database in which I'm faced with the following: A column 'unit_name' is defined as primary key and is a string, and another column 'id' is defined as a classic int identifier. My question is - how do I map this correct in…
Thestrup
  • 85
  • 1
  • 9
0
votes
1 answer

Cascading a Multi-Level Delete and N+1

I'm finding that cascading deletes is sending SQL with many individual deletes, i.e. the N+1 problem. I have three tables: User, UserAttribute and Attribute. Each User has many UserAttributes, each UserAttribute has one Attribute - represented by…
0
votes
1 answer

Using Laravel Collection methods(first, paginate etc) on a fluent query

I'm currently using Laravel's fluent queries to grab data from an MSSQL DB. In order to keep using Eloquent's methods (list, sort, filter etc), I'm wrapping the fluent queries in a new collection: return new Collection(…
liamstuff
  • 15
  • 4