Hi, Just getting started with SubSonic. I'm using the Repository pattern, so my domain objects are totally seperate, and SubSonic-generated classes are used only in my data access layer.
I'm wondering if a template exists that will give me a Save method (Insert/Update) that requires all table column values as parameters. My thinking is ...
All I am trying to find out the correct definition of the repository pattern.
My original understanding was this (extremely dumbed down)
Separate your Business Objects from your Data Objects
Standardize access methods in data access layer.
I have really seen 2 different implementation, and there are no formal examples online, the on...
I'm building the 2nd iteration of a web-based CRM+CMS for a franchise service business in ASP.NET MVC 2. I need to control access to each franchise's services based on the roles a user is assigned for that franchise.
4 examples:
Receptionist should be able to book service jobs in for her "Atlantic Seaboard" franchise, but not do any r...
I have been making a program that downloads information about movies from the internet. I have a base class Title, which represents all titles. Movie, Serie and Episode are inherited from that class.
To save them to the database I have 2 services, MovieService and SerieService. They in turn call repositories, but that is not important h...
Having some difficulty understanding the best way to implement subclasses with a generic repository using Fluent NHibernate.
I have a base class and two subclasses, say:
public abstract class Person
{
public virtual int PersonId { get; set; }
public virtual string FirstName { get; set; }
public virtual string LastName { get...
I spent the rest of the evening reading StackOverflow questions and also some blog entries and links about the subject. All of them turned out to be very helpful, but I still feel that they don't really answer my question.
So, I'm developing a simple web application. I'd like to create a reusable data access layer which I can later reus...
One of the things I like about the way I have Subversion set up is that I can have a single main repository with multiple projects. When I want to work on a project I can check out just that project. Like this
\main
\ProductA
\ProductB
\Shared
then
svn checkout http://.../main/ProductA
As a new user to git I want to exp...
Should each save/update method in a LINQ-to-SQL repository be wrapped in a new data context?
Consider the SavePage method in my partial SqlPageRepository:
public class SqlPageRepository : IPageRepository
{
private DB _db;
public SqlPageRepository(DB db) // I use IoC
{
_db = db;
}
public IQueryable<Page> Ge...
In a multi-tenant ASP.NET MVC application based on Rob Conery's MVC Storefront, should I be filtering the tenant's data in the repository or the service layer?
1. Filter tenant's data in the repository:
public interface IJobRepository
{
IQueryable<Job> GetJobs(short tenantId);
}
2. Let the service filter the repository data by te...
There are several similar questions on this matter, by I still haven't found enough reasons to decide which way to go.
The real question is, is it reasonable to abstract the NHibernate using a Repository pattern, or not?
It seems that the only reason behind abstracting it is to leave yourself an option to replace NHibernate with a diff...
When using the repository pattern is it recommended to have one Repository class for each database table? Would I also map one service layer class to one repository class. I'm having a hard time trying to understand how much stuff one repository or service layer class should have.
Thanks!
...
Hi guys
In the context of the n-tier application, is there a difference between what you would consider your data access classes to be and your repositories?
I tend to think yes but I just wanted to see what other thought. My thinking is that the job of the repository is just to contain and execute the raw query itself, where as the d...
I am trying to use Fluent NHibernate and the repository pattern. I would like my business layer to not be knowledgeable of the data persistence layer. Ideally I would pass in an initialized domain object to the insert method of the repository and all would be well.
Where I run into problems is if the object being passed in has a child ...
When using repository based persistence in a .net application, which collection type should normally be used?
IList, IEnumerable?
For example, the FindAll() method.
...
The repository pattern typically has Get*() and Save() (or equivalent) methods for each object. How does this fit into the object graph in EF? Consider the following with lazy-loading POCO objects:
// EF
var orderItems = context.OrderItems.Where(oi => oi.Order.Id == 123);
// Repository
IOrderItemsRepository orderItemsRepository = new...
Hello Stackoverflow
I have a code design question that have been torbeling me for a while, you see I’m doing a refactoring of my website Cosplay Denmark, a site where cospalyers can upload images of them self in their costumes. The original site was done in php, Zend MVC, but my refactoring is being done in ASP.NET MVC 2.
If you take t...
I'm designing a larger enterprise architecture and I'm in a doubt about how to separate the models and design those.
There are several points I'd like suggestions for:
- models to define
- way to define models
Currently my idea is to define:
Core (domain) model
Repositories to
get data to that domain model from a
database or other sto...
Hi all,
I have been implementing a new project which I have decided to use the repository pattern and Entity Framework.
I have sucessfuly implemented basic CRUD methods and I have no moved onto my DeepLoads.
From all the examples and documentation I can find to do this I need to call something like this:
public Foo DeepLoadFoo()
{
...
Given a basic repository interface:
public interface IPersonRepository
{
void AddPerson(Person person);
List<Person> GetAllPeople();
}
With a basic implementation:
public class PersonRepository: IPersonRepository
{
public void AddPerson(Person person)
{
ObjectContext.AddObject(person);
}
public List<...
I got some static classes with extension methods which add 'business logic' to entities using the repository pattern.
Now sometimes i need to create a new IRepository in these extension functions.
I'm currently working around it by accessing my Ninject kernel through the object I'm extending, but it's really ugly:
public static IEnume...