DepartmentProject/DepartmentPortal/Common/ToolsModule/Interfaces/IGenericEntityLogic.cs

61 lines
1.7 KiB
C#
Raw Normal View History

using ToolsModule.BindingModels;
using ToolsModule.ViewModels;
namespace ToolsModule.Interfaces
{
/// <summary>
/// Описание действий для логики сущности
/// </summary>
/// <typeparam name="G"></typeparam>
/// <typeparam name="S"></typeparam>
/// <typeparam name="L"></typeparam>
/// <typeparam name="E"></typeparam>
public interface IGenericEntityLogic<G, S, L, E> : IErrors
where G : GetBindingModel
where S : SetBindingModel
where L : ListViewModel<E>
where E : ElementViewModel
{
/// <summary>
/// Получение списка записей
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
L GetList(G model);
/// <summary>
/// Получение записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
E GetElement(G model);
/// <summary>
/// Создание записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
E Create(S model);
/// <summary>
/// Изменение записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
E Update(S model);
/// <summary>
/// Удаление записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
bool Delete(G model);
/// <summary>
/// Восстанолвение записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
E Restore(G model);
}
}