protected IActionResult Delete <T>(long id, string success = null) where T : class, IHaveID { IBaseEntityService <T> service = this.Services.OfType <IBaseEntityService <T> >().First(); return(this.ResponseServiceFunction <T, long>(service.Delete, id)); }
protected IActionResult AddOrUpdate <T>(T value, string success = null) where T : class, IHaveID { IBaseEntityService <T> service = this.Services.OfType <IBaseEntityService <T> >().First(); return(this.ResponseServiceFunction <T, T>(service.AddOrUpdate, value)); }
protected IActionResult GetAll <T>(string success = null) where T : class, IHaveID { IBaseEntityService <T> service = this.Services.OfType <IBaseEntityService <T> >().First(); return(this.ResponseServiceFunction(service.FindAll)); }
public ExamsController(IBaseEntityService <Examination> baseEntityService, IExamService examService, ProducerConfig producerConfig, IBaseRepository <Contest> contestRepo, IMapper mapper) { _examService = examService; _producerConfig = producerConfig; _contestRepo = contestRepo; _mapper = mapper; _baseEntityService = baseEntityService; }
public IntegrationsController(IUserService userService, IBaseEntityService <Contest> baseContestService, IBaseEntityService <Transcript> baseTranscriptService, IBaseRepository <Transcript> baseTranscriptRepo, IMapper mapper, IBaseEntityService <User> baseUserService) { _uri = new Uri("http://api.toedu.me"); _baseContestService = baseContestService; _baseTranscriptService = baseTranscriptService; _baseTranscriptRepo = baseTranscriptRepo; _mapper = mapper; _baseUserService = baseUserService; }
public static T GetBySeName <T>(this IBaseEntityService <T> entityService, string seName) where T : BaseEntity { //resolve permalink service var permalinkService = mobSocialEngine.ActiveEngine.Resolve <IPermalinkService>(); var entityname = typeof(T).Name; var permalink = permalinkService.FirstOrDefault(x => x.EntityName == entityname && x.Slug == seName && x.Active); if (permalink == null) { return(default(T)); } var entityId = permalink.EntityId; return(entityService.Get(entityId)); }
public static async Task <T> GetBySeNameAsync <T>(this IBaseEntityService <T> entityService, string seName) where T : BaseEntity { //resolve permalink service var permalinkService = EngineContext.Current.Resolve <IUrlRecordService>(); var entityname = typeof(T).Name; var permalink = await permalinkService.FirstOrDefaultAsync(x => x.EntityName == entityname && x.Slug == seName && x.IsActive); if (permalink == null) { return(default(T)); } var entityId = permalink.EntityId; return(await entityService.GetAsync(entityId)); }
public OptionController(IBaseEntityService <Option> optionService) { this.optionService = optionService; }
public UpdateEntityCommandHandler(IBaseEntityService <TEntity> baseService) { this.baseService = baseService; }
/// <summary> /// Khởi tạo service chung /// </summary> /// <param name="baseEntityService"></param> /// CreateBy: NVMANH (20/04/2020) public BaseEntityController(IBaseEntityService <T> baseEntityService) { _baseEntityService = baseEntityService; }
public TestController(IBaseEntityService <Brand> brandService) { _brandService = brandService; }
public TermsController(IBaseEntityService <Term> baseEntityService, ITermService termService, IContestService contestService) { _termService = termService; _baseEntityService = baseEntityService; }
public CategoriesController(IBaseEntityService <Category> service) { this.Services.Add(service); }
public BaseApiController(IBaseEntityService <TEntity, TEntityDto> baseEntityService, IValidatorFactory validationFactory) { _baseEntityService = baseEntityService; _validationFactory = validationFactory; }
public GenericQueryWithProjectCommandHandler(IBaseEntityService <TEntity> baseService) { this.baseService = baseService; }
public void SetUp() { _mockRepository = new MockRepository(); _repository = _mockRepository.DynamicMock<IRepository<BaseEntity>>(); _service = new BaseEntityService<BaseEntity>(_repository); }
public CampaignAppService(IBaseEntityService <Campaign> service) { _campaignService = service; }
public UsersController(IBaseEntityService <User> baseEntityService) : base(baseEntityService) { }
public ContestsController(IBaseEntityService <Contest> baseEntityService, IContestService contestService) { _contestService = contestService; _baseEntityService = baseEntityService; }