Убрали асбтракнные методы в бизнеслогике

This commit is contained in:
kotcheshir73 2021-03-28 19:24:53 +04:00
parent 9c5dffefbb
commit e8f9434a92
5 changed files with 4 additions and 38 deletions

View File

@ -81,7 +81,7 @@ namespace ModuleTools.BusinessLogics
return null;
}
return ConvertToL(result);
return result.Result as L;
}
catch (Exception ex)
{
@ -110,7 +110,7 @@ namespace ModuleTools.BusinessLogics
Errors.AddRange(Errors);
return null;
}
return ConvertToE(result);
return result.Result as E;
}
catch (Exception ex)
{
@ -140,7 +140,7 @@ namespace ModuleTools.BusinessLogics
return null;
}
return ConvertToE(result);
return result.Result as E;
}
catch (Exception ex)
{
@ -170,7 +170,7 @@ namespace ModuleTools.BusinessLogics
return null;
}
return ConvertToE(result);
return result.Result as E;
}
catch (Exception ex)
{
@ -208,19 +208,5 @@ namespace ModuleTools.BusinessLogics
}
return false;
}
/// <summary>
/// Получить список элементов
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
protected abstract L ConvertToL(OperationResultModel model);
/// <summary>
/// Получить элемент
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
protected abstract E ConvertToE(OperationResultModel model);
}
}

View File

@ -1,6 +1,5 @@
using ModuleTools.BusinessLogics;
using ModuleTools.Enums;
using ModuleTools.Models;
using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.Interfaces;
using SecurityBusinessLogic.ViewModels;
@ -13,9 +12,5 @@ namespace SecurityBusinessLogic.BusinessLogics
public class AccessBusinessLogic : BusinessLogicCore<AccessGetBindingModel, AccessSetBindingModel, AccessListViewModel, AccessViewModel>
{
public AccessBusinessLogic(IAccessService service) : base(service, "Доступы", AccessOperation.Доступы) { }
protected override AccessViewModel ConvertToE(OperationResultModel model) => model.Result as AccessViewModel;
protected override AccessListViewModel ConvertToL(OperationResultModel model) => model.Result as AccessListViewModel;
}
}

View File

@ -1,6 +1,5 @@
using ModuleTools.BusinessLogics;
using ModuleTools.Enums;
using ModuleTools.Models;
using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.Interfaces;
using SecurityBusinessLogic.ViewModels;
@ -14,9 +13,5 @@ namespace SecurityBusinessLogic.BusinessLogics
EnviromentSettingListViewModel, EnviromentSettingViewModel>
{
public EnviromentSettingBusinessLogic(IEnviromentSettingService service) : base(service, "Настройки Среды", AccessOperation.НастройкиСреды) { }
protected override EnviromentSettingViewModel ConvertToE(OperationResultModel model) => model.Result as EnviromentSettingViewModel;
protected override EnviromentSettingListViewModel ConvertToL(OperationResultModel model) => model.Result as EnviromentSettingListViewModel;
}
}

View File

@ -1,6 +1,5 @@
using ModuleTools.BusinessLogics;
using ModuleTools.Enums;
using ModuleTools.Models;
using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.Interfaces;
using SecurityBusinessLogic.ViewModels;
@ -13,9 +12,5 @@ namespace SecurityBusinessLogic.BusinessLogics
public class RoleBusinessLogic : BusinessLogicCore<RoleGetBindingModel, RoleSetBindingModel, RoleListViewModel, RoleViewModel>
{
public RoleBusinessLogic(IRoleService service) : base(service, "Роли", AccessOperation.Роли) { }
protected override RoleViewModel ConvertToE(OperationResultModel model) => model.Result as RoleViewModel;
protected override RoleListViewModel ConvertToL(OperationResultModel model) => model.Result as RoleListViewModel;
}
}

View File

@ -1,6 +1,5 @@
using ModuleTools.BusinessLogics;
using ModuleTools.Enums;
using ModuleTools.Models;
using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.Interfaces;
using SecurityBusinessLogic.ViewModels;
@ -13,9 +12,5 @@ namespace SecurityBusinessLogic.BusinessLogics
public class UserBusinessLogic : BusinessLogicCore<UserGetBindingModel, UserSetBindingModel, UserListViewModel, UserViewModel>
{
public UserBusinessLogic(IUserService service) : base(service, "Пользователи", AccessOperation.Пользователи) { }
protected override UserViewModel ConvertToE(OperationResultModel model) => model.Result as UserViewModel;
protected override UserListViewModel ConvertToL(OperationResultModel model) => model.Result as UserListViewModel;
}
}