CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of repository
C#
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Data.Objects;
using System.Linq;
using System.Linq.Expressions;
using BusinessDomain.Entities;
using Microsoft.VisualStudio.TestTools.UnitTesting;
by biboyatienza   June 13, 2011 @ 9:22pm
963 Views
no comments
 
C#
 
 public interface IKeyedRepository<TKey, TEntity> : IRepository<TEntity> 
     where TEntity : class, IKeyed<TKey>
 {
    TEntity FindBy(TKey id);
 }
 public interface IRepository<TEntity> : IReadOnlyRepository<TEntity> where TEntity:class
 {
     bool Add(TEntity entity);
     bool Add(IEnumerable<TEntity> items);
by Bob Cravens   February 21, 2011 @ 8:01am
363 Views
no comments
 
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Linq;
 
namespace HelpDesk.Models {
    public interface IGenericRepository {
        IQueryable<T> Get<T>() where T : class;
        void Insert<T>(T item) where T : class;
by davecowart   March 17, 2010 @ 1:49pm
773 Views
no comments
 
C#
public class MyRegistry : Registry 
{
    public MyRegistry()
    {
        // DataContext
        ForRequestedType<DataContext>()
            .CacheBy(InstanceScope.HttpContext)
            .TheDefault.Is.ConstructedBy(() => new DataContext(DecriptConectionString()));
 
        // Unit of work
by Fernando Claverino   December 28, 2009 @ 1:58pm
624 Views
1 comments
 
C#
public interface IRepository<T, TPkType>
{
    IQueryable<T> Select();
    T SelectOnId(TPkType id);
    IQueryable<T> SelectPaged<TResult>(int pageIndex, int pageSize, Expression<Func<T, TResult>> sortExpression, bool isAscending);
    IQueryable<T> FindPaged<TResult>(int pageIndex, int pageSize, Expression<Func<T, bool>> findExpression, Expression<Func<T, TResult>> sortExpression, bool isAscending);
    IQueryable<T> Find(Expression<Func<T, bool>> expression);
    T Save(T item);
    void Delete(TPkType id);
}
by JeffSpicolie   September 24, 2009 @ 4:30pm
623 Views
no comments
 
C#
public interface IRepository<TEntity> where TEntity : EntityObject
{
   TEntity GetById(int id);
   IQueryable<TEntity> GetAll();
 
   IQueryable<TEntity> Query();
 
   IRepository<TEntity> With(Expression<Func<TEntity, object>> path);
   IRepository<TEntity> With<T>(Expression<Func<T, object>> path);
}
by Dennis van der Stelt   July 22, 2009 @ 5:25am
629 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate