12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- using Microsoft.AspNetCore.Http;
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Threading.Tasks;
- using TEAMModelOS.Model.Core.Models;
- using TEAMModelOS.SDK.Module.AzureTable.Interfaces;
- using TEAMModelOS.Service.Core.Interfaces;
- namespace TEAMModelOS.Service.Core.Implements
- {
- public class RoleService : IRoleService
- {
- private IAzureTableDBRepository _repository;
- private IHttpContextAccessor _httpContextAccessor;
- public RoleService(IAzureTableDBRepository repository,IHttpContextAccessor httpContextAccessor)
- {
- _httpContextAccessor = httpContextAccessor;
- _repository = repository;
- }
- public async Task<List<Role>> FindRolesByDict(Dictionary<string, object> dict)
- {
- if (dict.Count <= 0)
- {
- return await _repository.FindAll<Role>();
- }
- else
- {
- return await _repository.FindListByDict<Role>(dict);
- }
- }
- public async Task<List<RoleSchool>> FindRolesSchoolByDict(Dictionary<string, object> dict)
- {
- if (dict.Count <= 0)
- {
- return await _repository.FindAll<RoleSchool>();
- }
- else
- {
- return await _repository.FindListByDict<RoleSchool>(dict);
- }
- }
- }
- }
|