fluent

Fluent NHibernate - recursive maps

I have an object that represents a Location. Locations can contain other locations. How can I represent this relationship with Fluent NHibernate. The class looks like this: public class Location : EntityBase { #region Properties public string LocationName { get; set; } public Location ParentLocation { get; private set; } ...

How to join table in fluent nhibernate

how do we do this but fluently? i know i can use 'References' but i don't need all the columns from the related table. i just need one property. ...

How to do Insert New Result At the same Table by one-to-one Relation using Fluent

At Same table I Have 2 Objects: Product, ProductDetail public class Product { public virtual int ID {get;set;} public virtual string Name {get;set;} public virtual Detail {get;set;} } public class ProductDetail { public virtual int ID {get;set;} public virtual string Title {get;set;} public virtual Product P...

Fluent nHibernate no identity column in table...

How do I specify with fluent nHbiernate mapping for a table that doesn't have an identity column? I want something like this: public sealed class CustomerNewMap : ClassMap<CustomerNew>, IMap { public CustomerNewMap() { WithTable("customers_NEW"); Not.LazyLoad(); Not.Id(); // this is invalid... Ma...

Fluent NHibernate HasManyToMany() Mapping Problem

Hi, i am having a problem in Fluent NHibernate example utilizing the Many-to-Many relationships, i tried to find out examples on a similar case, and i found tons , but still having the same problem. when run the test project the following exception is thrown: NHibernate.PropertyAccessException: Exception occurred getter of project.Enti...

Are there any fluent WPF projects?

As part of my on-going attempt to come to terms with WPF/XAML, I've become interested in the application of fluent interfaces to UI coding. I am aware of Fluent Silverlight (http://code.google.com/p/fluent-silverlight/), but I can't seem to find anything equivalent for WPF. Just as a personal note, I'm finding it very difficult to buy ...

Is there a nice simple & elegant way to make ICollection more fluent in C#?

Example: I would like to have the Add method of ICollection of a custom collection class to implement method chaining and fluent languages so I can do this: randomObject.Add("I").Add("Can").Add("Chain").Add("This"). I can think of a few options but they are messy and involves wrapping ICollection in another interface and so forth. ...

Multi-level inheritence with fluent interface in C#

Given the sample console application below: QUESTION #1: Why does .Name() return typeof OranizationBuilder, but .Write() calls CorporationBuilder? QUESTION #2: How to get .Name() to return typeof CorporationBuilder? namespace MyCompany { using System; class Program { static void Main(string[] args) { ...

C# Fluent API for building Controls : Feedback Required

I've been working away (http://tinyurl.com/m4hzjb) on this Fluent API for instantiating ASP.NET controls and feel I now have something that appears to work well. I'm looking for some feedback and opinions... good, bad or indifferent. Would you find this useful? Any technical issues you foresee? Room for improvement? Here's a very basic ...

Ruby list of tags to a fluent regex

I want to clean an HTML page of its tags, using Ruby. I have the raw HTML, and would like to define a list of tags, e.g. ['span', 'li', 'div'], and create an array of regular expressions that I could run sequentially, so that I have clean_text = raw.gsub(first_regex,' ').gsub(second_regex,' ')... with two regular expressions per tag (...

Fluent NHibernate: Weird column mapping behaviour

I am having a number of problems trying to map entities using Fluent NHibernate. I have three entities, like this: public class Product { public virtual Guid Id { get; set; } public virtual Category Category { get; set; } public virtual Seller Seller { get; set; } } public class Seller { public virtual Guid Id { get; s...

Fluent NHibernate hierarchical data

Hey all. Quick question on Fluent syntax. I had thought I had this down, but I'm getting a weird failure. Basically, I have a hierarchical kind of structure that I'm trying to persist, and it all seems to work, except when I do an actual integration test w/ the db. I have a Node object which has a Parent property, which is another Nod...

FluentNHibernate mapping for Dictionary

What is the best way of mapping a simple Dictionary property using Fluent NHibernate? ...

Fluent NHibernate HasManyToMany() Save/Update Problem

Hi, i have the following code, which is supposed to give specific functionality but it isn't :S anyway, here's my problem: http://img525.imageshack.us/img525/1315/diagramp.png here's the mapping code: public class UsersMap : ClassMap<User> { public UsersMap() { this.Table("Users"); Id(x => x.UserName).Generat...

Set up caching on entities and relationships in Fluent Nhibernate?

Do anyone have have an example how to set up and what entities to cache in fluent nhibernate. Both using fluent mapping and auto mapping? And the same for entity relationships, both one to many and many to many? ...

Best way to store enum values in database - String or Int

Hello there, I have a number of enums in my application which are used as property type in some classes. What is the best way to store these values in database, as String or Int? FYI, I will also be mapping these attribute types using fluent Nhibernate. Sample code: public enum ReportOutputFormat { DOCX, PDF, HTML } pub...

Map List<Int32> using Fluent Nhibernate

Hello there, I need to map List<Int32> using Fluent Nhibernate. Sample code: public class ReportRequest { public List<Int32> EntityIds { get { return entityIds; } set { entityIds = value; } } } Please guide. Thank you! ...

NHibernate Fluent and named Queries

Hi there, I am using Nhibernate with fluent. Now I want to call some Stored procedure and use named Queries. I created some xml: <?xml version="1.0" encoding="utf-8"?> <hibernate-mapping> <sql-query name="CleanAppendicesHierarchies"> exec intf_CleanUpAppendixHierarchy </sql-query> </hibernate-mapping> FluentConfiguratio...

Fluent NHibernate Bidirectional Mapping - results in two similar referencing columns

Hello there, I am trying to implement Bidirectional Mapping with Fluent NHibernate Mapping. Code snippet from Domain classes: public class Template { public virtual int? Id { get; set; } public virtual string Title { get; set; } public virtual TemplateGroup TemplateParentGroup { get; set; } } public class TemplateGroup ...

creating API that is fluent

How does one go about create an API that is fluent in nature? Is this using extension methods primarily? ...