Ejemplo n.º 1
0
        /// <summary>
        /// 配置需要生成页面的Crud服务
        /// </summary>
        /// <typeparam name="TEntityDto"></typeparam>
        /// <typeparam name="TPrimaryKey"></typeparam>
        /// <typeparam name="TCreateInput"></typeparam>
        /// <typeparam name="TUpdateInput"></typeparam>
        /// <typeparam name="TGetListInput"></typeparam>
        /// <param name="service"></param>
        public void SetCrudService <TEntityDto, TPrimaryKey, TCreateInput, TUpdateInput, TGetListInput, TListEntityDto>(
            ICrudAppService <TEntityDto, TPrimaryKey, TCreateInput, TUpdateInput, TGetListInput, TListEntityDto> service)
            where TEntityDto : IEntityDto <TPrimaryKey>
            where TCreateInput : IEntityDto <TPrimaryKey>
            where TUpdateInput : IEntityDto <TPrimaryKey>
            where TListEntityDto : IEntityDto <TPrimaryKey>
        {
            DtoTypes.Clear();
            DtoTypes["Entity"]     = typeof(TEntityDto);
            DtoTypes["EntityDto"]  = typeof(TEntityDto);
            DtoTypes["CreateDto"]  = typeof(TCreateInput);
            DtoTypes["UpdateDto"]  = typeof(TUpdateInput);
            DtoTypes["PrimaryKey"] = typeof(TPrimaryKey);
            DtoTypes["GetListDto"] = typeof(TGetListInput);

            var entityName = typeof(TEntityDto).Name;

            if (entityName.EndsWith("Dto"))
            {
                entityName = entityName.Substring(0, entityName.Length - 3);
            }
            ValueSet("EntityName", entityName);
            ValueSet("EntityDtoName", entityName);

            var createDtoName = typeof(TCreateInput).Name;

            if (createDtoName.EndsWith("Dto"))
            {
                createDtoName = createDtoName.Substring(0, createDtoName.Length - 3);
            }
            ValueSet("CreateDtoName", createDtoName);

            var updateDtoName = typeof(TCreateInput).Name;

            if (updateDtoName.EndsWith("Dto"))
            {
                updateDtoName = updateDtoName.Substring(0, updateDtoName.Length - 3);
            }
            ValueSet("UpdateDtoName", updateDtoName);

            var getAllDtoName = typeof(TCreateInput).Name;

            if (getAllDtoName.EndsWith("Dto"))
            {
                getAllDtoName = getAllDtoName.Substring(0, getAllDtoName.Length - 3);
            }
            ValueSet("GetListDtoName", getAllDtoName);
        }
 public CrudApiControllerBase(ICrudAppService <TKey, TEntityDto, TEntityAddDto, TEntityUpdateDto, TEntityQueryIntputDto, TEntityPageQueryInputDto> appService)
 {
     this.appService = appService;
 }
Ejemplo n.º 3
0
 public TipoTarefaService(IMapper mapper, ICrudAppService <TipoTarefaViewModel> tipoTarefaAppService)
 {
     _mapper = mapper;
     _tipoTarefaAppService = tipoTarefaAppService;
 }
Ejemplo n.º 4
0
 public ProjetoService(IMapper mapper, ICrudAppService <ProjetoViewModel> projetoAppService)
 {
     _mapper            = mapper;
     _projetoAppService = projetoAppService;
 }
Ejemplo n.º 5
0
 public ProjetoController(ICrudAppService <ProjetoViewModel> projetoAppService)
 {
     _projetoAppService = projetoAppService;
 }
Ejemplo n.º 6
0
 public ImpedimentoController(ICrudAppService <ImpedimentoViewModel> impedimentoAppService)
 {
     _impedimentoAppService = impedimentoAppService;
 }
Ejemplo n.º 7
0
 public SistemaController(ICrudAppService <SistemaViewModel> sistemaAppService)
 {
     _sistemaAppService = sistemaAppService;
 }
Ejemplo n.º 8
0
 public ImpedimentoService(IMapper mapper, ICrudAppService <ImpedimentoViewModel> impedimentoAppService)
 {
     _mapper = mapper;
     _impedimentoAppService = impedimentoAppService;
 }
Ejemplo n.º 9
0
 public WorkflowController(ICrudAppService <WorkflowViewModel> workflowAppService)
 {
     _workflowAppService = workflowAppService;
 }
Ejemplo n.º 10
0
 protected CrudBaseController(ICrudAppService <TEntityDto, TCreateInput, TUpdateInput> service)
 {
     Service = service;
 }
Ejemplo n.º 11
0
 public SistemaService(IMapper mapper, ICrudAppService <SistemaViewModel> sistemaAppService)
 {
     _mapper            = mapper;
     _sistemaAppService = sistemaAppService;
 }
Ejemplo n.º 12
0
 public WorkflowService(IMapper mapper, ICrudAppService <WorkflowViewModel> workflowAppService)
 {
     _mapper             = mapper;
     _workflowAppService = workflowAppService;
 }
Ejemplo n.º 13
0
 /// <summary>
 /// 初始化一个<see cref="CrudControllerBase{TDto, TQuery}"/>类型的实例
 /// </summary>
 /// <param name="service">Crud服务</param>
 protected CrudControllerBase(ICrudAppService <TDto, TQuery> service) : base(service)
 {
 }
Ejemplo n.º 14
0
 public TipoTarefaController(ICrudAppService <TipoTarefaViewModel> tipoTarefaAppService)
 {
     _tipoTarefaAppService = tipoTarefaAppService;
 }