fluent-interface Questions

0

I am having some issues with the concept of fluent setters. I created 2 classes that extends from the same parent. And I put the common attributes between them in the parent class and I want to put...
Exhaust asked 10/11, 2016 at 0:12

5

Solved

See below codes : new ConditionCreator() .Add() .Or() .Add() .And() .Add() I want to create a Fluent Interface for that But I need, after Add() method developer see Only Or() or And() and...
Kremer asked 26/4, 2016 at 10:17

7

Solved

I have a class Product and a complex type AddressDetails public class Product { public Guid Id { get; set; } public AddressDetails AddressDetails { get; set; } } public class AddressDetails { ...
Rexfourd asked 28/2, 2013 at 8:30

4

Solved

I've been writing a bunch of email code lately and it occurred to me that it'd be pretty cool if there was a library that allowed you to fluently create an email in c#. I had a quick look around b...
Masonite asked 17/2, 2011 at 12:8

2

Solved

I wanted to share my question/answer with using the new JSR-353 which is the Java API for JSON Processing. Specifically you can manipulate JSON data in 2 different "API" the Streaming and the Objec...
Batchelor asked 9/11, 2014 at 21:18

2

Solved

I have created a set of classes to represent a directed cyclic graph for representing BPM processes, based on JUNG's DirectedSparseGraph class, which provides only basic graph manipulation methods ...
Abomination asked 6/3, 2015 at 15:51

7

Solved

tl;dr Trying to implement a hierarchal fluent interface such that I can combine nodes child classes while also the class standalone, but getting type parameter is not within its bound errors. De...
Peal asked 10/10, 2014 at 17:4

1

Solved

Fluent APIs are awesome. They give concise and readable code. But it is a severe pain when something works as not expected. Are there any ways to see the intermediate results of the method calls c...
Pejorative asked 26/3, 2013 at 7:44

3

I have a table with a self reference where the ParentId is an FK to the ID (PK). Using EF (code-first), I've set up my relationship as follows: this.HasOptional(t => t.ParentValue) .WithMany(...
Yielding asked 9/5, 2013 at 14:8

5

Solved

I'm writing a fluent API to configure and instantiate a series of "message" objects. I have a hierarchy of message types. To be able to access method of subclasses when using the fluent API, I use...
Transportation asked 19/5, 2014 at 6:44

2

Problem: Implementing fluent interface with many methods yields class complexity metric growing very fast. How to keep low complexity for class which implements fluent interface? Some informatio...
Tortuosity asked 14/3, 2014 at 16:29

1

Solved

Using Entity Framework's API I keep coming across the following two ways to map many to many relationships? I have never used the second option... what is the difference? Option 1: modelBuilder.E...
Midget asked 22/2, 2014 at 12:45

2

Solved

I wanted to create a fluent interface that can be used like so: void Main() { ModelStateMappings.MapDomainModel<Book>().MapViewModel<BookViewModel>() .Properties(book => book.Auth...
Sprinkler asked 6/1, 2014 at 22:40

2

Solved

Hi i'm trying to understand how i could build a readable and also error preventing Fluent-API without to much restriction for the User to hold it simple let's say we want to change the following c...
Spoonful asked 17/9, 2013 at 10:0

2

Solved

I have a base class public class BaseClass { public int Id {get; set;} } and two derived classes public class Foobar: BaseClass { [Required] public int Whatever {get; set;} } public class S...

4

Solved

I recently came up to an interesting question, what should fluent methods return? Should they change state of current object or create a brand new one with new state? In case this short descripti...
Offoffbroadway asked 7/11, 2013 at 16:39

1

So following the solution described in Java - Inherited Fluent method return type to return incident class' type, not parent's. I want to extend it to multiple levels. The solution works i...
Versicolor asked 17/10, 2013 at 2:5

1

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 Base...
Pierre asked 17/10, 2013 at 20:17

2

Solved

This is probably just because my knowledge with the EF Code First fluent API is lacking, but I'm stumped. I want to model the following: A Groups collection with Id and Name A Users collection w...

2

Solved

HELP! - I am receiving the following error on my navigational model ArticleType: A relationship multiplicity constraint violation occurred Here is the existing database schema: Here is my c...
Malta asked 14/9, 2013 at 5:45

2

Solved

Forgive me if this question seems stupid, but I'm quite new to the whole world of functional programming so I'll need some denizens on StackOverflow to set me straight. From what I gather, an oper...
Pomiculture asked 25/3, 2011 at 21:32

8

Solved

I'm after some good tips for fluent interfaces in C#. I'm just learning about it myself but keen to hear what others think outside of the articles I am reading. In particular I'm after: when is f...
Zymogen asked 22/10, 2008 at 7:13

4

I have the following extension methods: public static IFoo Foo(this IFluentApi api, Action action); public static IFoo<TResult> Foo<TResult>( this IFluentApi api, Func<TResult>...
Gaseous asked 24/7, 2013 at 18:55

3

Solved

I know how to chain class methods (with the "return $this" and all), but what i am trying to do is to chain them in a smart way, have a look at this: $albums = $db->select('albums')->where('...
Zibet asked 1/7, 2013 at 19:46

1

I have the following class: public class User { public Guid Id { get; set; } public string Name { get; set; } public Couple Couple { get; set; } } public class Couple { public Guid Id { get; ...
Funk asked 12/10, 2011 at 14:59

© 2022 - 2024 — McMap. All rights reserved.