Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9275043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:29:46+00:00 2026-06-18T16:29:46+00:00

In our next project we have a need for using interfaces like this (Example

  • 0

In our next project we have a need for using interfaces like this (Example code)

public interface IFoo
{
    string Name {get; set;}
    IList<IBar> Bars {get; set;}
}

public interface IBar
{
    string Name {get;set;}
    IList<IFoo> Foos {get;set;
}


public class Foo : IFoo
{
    public string Name {get; set;}
    public IList<IBar> Bars {get; set;}
}

public class Bar : IBar
{
    public string Name {get; set;}
    public IList<IFoo> Foos {get;set;}
}

Obviously, in the application layer, we wish to be using the interfaces, and have no knowlegde what so ever about the implementing class.

I’ve been looking at a few OR/M’s – We currently own LLBLGen, I have tried EntityFramework and it was a nightmare, didn’t get it to work either, looked into NHibernate but the fact that the getting-started procedure is so complicated relative to LLBLGen scared me away (but I am still open for NHibernate if it supports my needs).

So, what I am looking for: A simple OR/M that I can use with minimal setup requirements (LLBLGen you just use their tool to reverse engineer your DB, and generate source code, and you can begin coding), which supports the structure above.

On a side note: Could anyone tell me what the pattern I am looking for is called? (other than ultra-slothfull 😉 )

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T16:29:48+00:00Added an answer on June 18, 2026 at 4:29 pm
    // mappings
    public class FooMap : ClassMap<Foo>
    {
        public FooMap()
        {
            Map(f => f.Name);
            HasMany(f => f.Bars).KeyColumn("foo_Id");
        }
    }
    
    public class BarMap : ClassMap<Bar>
    {
        public BarMap()
        {
            Map(f => f.Name);
        }
    }
    
    // query
    var john = session.Query<IFoo>()
        .Where(f => f.Name == "John")
        .Fetch(f => f.Bars)
        .Single();
    
    Console.Writeline(john.Bars.Count);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have thought a bit about running a noSQL database for our next project.
I need to write an autoupdate script for our project. I have everything, except
Our client wants to support both SQL Server and Oracle in the next project.
I have an existing ASP.Net MVC project that is using entities / repositories in
We are considering Terracotta for our next project. I am intrigued by its potential
We are using JSF in our project (im pretty new to it) were every
We have a large project with several sub-projects. We're approaching a release of our
On the current project I'm working on, we have the following problem. Our software
I took a class named Secure Code, and in our next assignment we are
In next release of our product we are adding builders. This change will be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.