Advertisement
mitakabg3

CRUD syntax interface

Jun 24th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.67 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Linq.Expressions;
  5. using System.Text;
  6.  
  7. namespace CarDealer.Database.Repository.Interfaces
  8. {
  9.     public interface IBaseRepository<T> where T : class
  10.     {
  11.         IQueryable<T> All();
  12.         IQueryable<T> AllIncluding(params Expression<Func<T, object>>[] includeProperties);
  13.         T GetById(int id);
  14.         T Add(T entity, bool saveChanges = true);
  15.         void AddRange(IEnumerable<T> entityList, bool saveChanges = true);
  16.         void Delete(T entity);
  17.         void DeleteRange(List<int> ids);
  18.         void DeleteRange(IEnumerable<T> itemsToRemove);
  19.         int SaveChanges();
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement