public virtual void Insert(T entity) { try { if (entity == null) { throw new ArgumentNullException("entity"); } Entities.Add(entity); if (Context == null || _isDisposed) { Context = new EBusValidatorContext(); } //Context.SaveChanges(); commented out call to SaveChanges as Context save changes will be //called with Unit of work } catch (DbEntityValidationException dbEx) { foreach (var validationErrors in dbEx.EntityValidationErrors) { foreach (var validationError in validationErrors.ValidationErrors) { _errorMessage += string.Format("Property: {0} Error: {1}", validationError.PropertyName, validationError.ErrorMessage) + Environment.NewLine; } } throw new Exception(_errorMessage, dbEx); } }
public TransactionRepository(EBusValidatorContext context) : base(context) { }
public SmartcardRepository(EBusValidatorContext context) : base(context) { }
public GuardianRepository(EBusValidatorContext context) : base(context) { }
public GenericRepository(EBusValidatorContext context) { _isDisposed = false; Context = context; }