35 lines
1.9 KiB
C#
35 lines
1.9 KiB
C#
using DatabaseCore;
|
|
using DatabaseCore.Models.Security;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using ModuleTools.Models;
|
|
using SecurityBusinessLogic.BindingModels;
|
|
using SecurityBusinessLogic.Interfaces;
|
|
using SecurityBusinessLogic.ViewModels;
|
|
using System.Linq;
|
|
|
|
namespace SecurityDatabaseImplementation.Implementations
|
|
{
|
|
/// <summary>
|
|
/// Реализация IEnviromentSettingService
|
|
/// </summary>
|
|
public class EnviromentSettingService :
|
|
AbstractGenerticEntityService<EnviromentSettingGetBindingModel, EnviromentSettingSetBindingModel, EnviromentSetting, EnviromentSettingListViewModel, EnviromentSettingViewModel>,
|
|
IEnviromentSettingService
|
|
{
|
|
protected override OperationResultModel AdditionalCheckingWhenAdding(DbContext context, EnviromentSettingSetBindingModel model) => OperationResultModel.Success(null);
|
|
|
|
protected override OperationResultModel AdditionalCheckingWhenDeleting(DbContext context, EnviromentSetting entity, EnviromentSettingGetBindingModel model) => OperationResultModel.Success(null);
|
|
|
|
protected override IQueryable<EnviromentSetting> AdditionalCheckingWhenReadingList(IQueryable<EnviromentSetting> query, EnviromentSettingGetBindingModel model) => query;
|
|
|
|
protected override OperationResultModel AdditionalCheckingWhenUpdateing(DbContext context, EnviromentSettingSetBindingModel model) => OperationResultModel.Success(null);
|
|
|
|
protected override void AdditionalDeleting(DbContext context, EnviromentSetting entity, EnviromentSettingGetBindingModel model) { }
|
|
|
|
protected override EnviromentSetting GetUniqueEntity(EnviromentSettingSetBindingModel model, DbContext context) => context.Set<EnviromentSetting>().FirstOrDefault(x => x.Key == model.Key && x.Id != model.Id);
|
|
|
|
protected override IQueryable<EnviromentSetting> IncludingWhenReading(IQueryable<EnviromentSetting> query) => query;
|
|
|
|
protected override IQueryable<EnviromentSetting> OrderingWhenReading(IQueryable<EnviromentSetting> query) => query.OrderBy(x => x.Key);
|
|
}
|
|
} |