This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Data.Entity; | |
using System.Linq; | |
namespace EFRepository.Infrastructure | |
{ | |
/// <summary> | |
/// A EFRepository represents the repository for performing operations on the | |
/// Entity using the EntityFramework. | |
/// </summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace EFRepository.Infrastructure | |
{ | |
[Serializable] | |
public class UnitOfWorkException : Exception | |
{ | |
public override string Message | |
{ | |
get |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace EFRepository.Infrastructure | |
{ | |
/// <summary> | |
/// The Interface for implementing a UnitOfWork in the Repository | |
/// </summary> | |
public interface IUnitOfWork : IDisposable | |
{ | |
void Commit(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
namespace EFRepository.Infrastructure | |
{ | |
/// <summary> | |
/// Generic interface for the Repository. | |
/// </summary> | |
/// <typeparam name="T">EntityType T</typeparam> | |
public interface IRepository<T> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Data.Entity; | |
namespace EFRepository.Infrastructure | |
{ | |
/// <summary> | |
/// Represents an IUnitOfWork for Entity Framework | |
/// </summary> | |
public class EFUnitOfWork : IUnitOfWork | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IRepository<T> where T: class | |
{ | |
void Add( T Entity); | |
void Delete( T Entity); | |
void Update ( T Entity); | |
IQueryable<T> GetAll<T>(); | |
//some more methods | |
} | |
public interface IDatabaseFactory : IDisposable |
NewerOlder