COA.EnterpriseServices/COA.EnterpriseServices.DataAccess/IDataAccess.cs

39 lines
1.2 KiB
C#
Raw Normal View History

2020-10-14 00:56:53 +00:00
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
namespace COA.EnterpriseServices.DataAccess
{
2020-10-14 01:24:27 +00:00
public interface IDataAccess<T> where T : class, IRecord
2020-10-14 00:56:53 +00:00
{
/// <summary>
/// Adds an item of type <typeparamref name="T"/> to the context
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
2020-10-14 00:56:53 +00:00
bool Add(T item);
/// <summary>
/// Updates an item of type <typeparamref name="T"/> in the context
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
2020-10-14 00:56:53 +00:00
bool Update(T item);
/// <summary>
/// Gets an item collection of type <typeparamref name="T"/> from the context
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
2020-10-14 00:56:53 +00:00
ICollection<T> Get(Expression<Func<T, bool>> query);
/// <summary>
/// Allows support for invoking a raw command if supported by the instance
/// </summary>
/// <param name="command"></param>
/// <param name="parameters"></param>
/// <returns></returns>
ICollection<T> Raw(string command, params object[] parameters);
2020-10-14 00:56:53 +00:00
}
}