Format:
Recent snippets matching tags of repository
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;
963 Views
no comments
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);
363 Views
no comments
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;
773 Views
no comments
public class MyRegistry : Registry { public MyRegistry() { // DataContext ForRequestedType<DataContext>() .CacheBy(InstanceScope.HttpContext) .TheDefault.Is.ConstructedBy(() => new DataContext(DecriptConectionString())); // Unit of work
624 Views
1 comments
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); }
623 Views
no comments
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); }
629 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
