private void AddOrModify() { if (_comparer == null) { throw new ArgumentNullException(); } if (_updates == null) { return; } foreach (var u in _updates) { var p = _existing.SingleOrDefault(ep => _comparer(ep, u)); if (p == null) { _context.Set <T>().Add(u); } else if (_mapUpdates != null) { _mapUpdates(p, u); _context.SetEntityState(p, EntityState.Modified); } } }
private IEnumerable <T> GetAll <T>() where T : BaseEntity { return(Context.Set <T>().AsEnumerable()); }
/// <summary> /// Gets all of an entity. /// </summary> /// <typeparam name="T"></typeparam> /// <returns>Returns an IEnumerable of the entity.</returns> protected IEnumerable <T> GetAll <T>() where T : Entity { return(Context.Set <T>().AsEnumerable()); }