remove single Get()
This commit is contained in:
parent
aab741d1f0
commit
97622a576c
@ -2,7 +2,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Text;
|
||||
|
||||
namespace COA.EnterpriseServices.DataAccess.EntityFramework
|
||||
{
|
||||
@ -32,11 +31,6 @@ namespace COA.EnterpriseServices.DataAccess.EntityFramework
|
||||
return true;
|
||||
}
|
||||
|
||||
public T Get(int id)
|
||||
{
|
||||
return Get(r => r.Id == id).FirstOrDefault();
|
||||
}
|
||||
|
||||
public ICollection<T> Get(Expression<Func<T, bool>> query)
|
||||
{
|
||||
using (var context = new QuickBaseContext())
|
||||
|
@ -20,12 +20,6 @@ namespace COA.EnterpriseServices.DataAccess.QuickBase
|
||||
return true;
|
||||
}
|
||||
|
||||
public T Get(int id)
|
||||
{
|
||||
// we'll never get data from QB
|
||||
return null;
|
||||
}
|
||||
|
||||
public ICollection<T> Get(Expression<Func<T, bool>> query)
|
||||
{
|
||||
// we'll never get data from QB
|
||||
|
@ -1,10 +1,12 @@
|
||||
namespace COA.EnterpriseServices.DataAccess.Helpers
|
||||
using System.Linq;
|
||||
|
||||
namespace COA.EnterpriseServices.DataAccess.Helpers
|
||||
{
|
||||
public class BaseHelper<T> where T : class, IRecord
|
||||
{
|
||||
protected DataAccessManager<T> DataAccessManager { get; } = new DataAccessManager<T>();
|
||||
|
||||
public virtual T Get(int id) => DataAccessManager.Invoke(d => d.Get(id));
|
||||
public virtual T Get(int id) => DataAccessManager.Invoke(d => d.Get(i => i.Id == id).FirstOrDefault());
|
||||
|
||||
public virtual bool Add(T item) => DataAccessManager.Invoke(d => d.Add(item));
|
||||
}
|
||||
|
@ -10,8 +10,6 @@ namespace COA.EnterpriseServices.DataAccess
|
||||
|
||||
bool Update(T item);
|
||||
|
||||
T Get(int id);
|
||||
|
||||
ICollection<T> Get(Expression<Func<T, bool>> query);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user