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 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.
...
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...
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...
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...
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 ...
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. ...
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)
{
...
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 ...
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 (...
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...
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...
What is the best way of mapping a simple Dictionary property using Fluent NHibernate?
...
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...
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?
...
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...
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!
...
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...
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
...
How does one go about create an API that is fluent in nature?
Is this using extension methods primarily?
...