Example #1
0
 public BookDataController
 (
     ICrudService <Book> crudService
 )
 {
     _crudService = crudService;
 }
 public CustomerDataController
 (
     ICrudService <Customer> crudService
 )
 {
     _crudService = crudService;
 }
        public LoginModel(ICrudService <User> userService, SessionService sessionService)
        {
            _userService = userService;
            _userService.Init(ModelTypes.User);

            _sessionService = sessionService;
        }
Example #4
0
        public AdminLokalePageModel(ICrudService <Room> roomService, ICrudService <Floor> floorService,
                                    ICrudService <Event> eventService, ICrudService <RoomFeature> roomFeatureService,
                                    ICrudService <Feature> featureService, ICrudService <User> userService, ICrudService <Conference> conferenceService,
                                    ICrudService <UserConferenceBinding> ucBindingService, SessionService sessionService)
        {
            _sessionService = sessionService;

            _roomService        = roomService;
            _floorService       = floorService;
            _eventService       = eventService;
            _roomFeatureService = roomFeatureService;
            _featureService     = featureService;
            _userService        = userService;
            _conferenceService  = conferenceService;
            _ucBindingService   = ucBindingService;

            _roomService.Init(ModelTypes.Room);
            _floorService.Init(ModelTypes.Floor);
            _eventService.Init(ModelTypes.Event);
            _featureService.Init(ModelTypes.Feature);
            _userService.Init(ModelTypes.User);
            _conferenceService.Init(ModelTypes.Conference);
            _ucBindingService.Init(ModelTypes.UserConferenceBinding);
            _roomFeatureService.Init_Composite(ModelTypes.Feature, ModelTypes.Room, ModelTypes.RoomFeature);
        }
Example #5
0
 public TeacherController(
     ICrudService <Teacher> teacherService,
     ICrudService <Student> studentService
     )
 {
     this.teacherService = teacherService;
 }
 public DropdownServices(
     ICrudService <Country> countryService,
     ICrudService <City> cityService,
     ICrudService <Currency> currencyService,
     ICrudService <Season> seasonService,
     ICrudService <Color> colorServices,
     ICrudService <TopCategory> topCategoryService,
     ICrudService <MainCategory> mainCategoryService,
     ICrudService <Group> groupService,
     ICrudService <Component> componentService,
     ICrudService <CountryOfOrigin> countryOfOriginService,
     ICrudService <Supplier> supplierService,
     ICrudService <CodeCn> codeCnService,
     ICrudService <Set> setService,
     ICrudService <ColorName> colorNameService,
     ICrudService <Size> sizeService)
 {
     CountryService         = countryService;
     CityService            = cityService;
     CurrencyService        = currencyService;
     SeasonService          = seasonService;
     ColorService           = colorServices;
     TopCategoryService     = topCategoryService;
     MainCategoryService    = mainCategoryService;
     GroupService           = groupService;
     ComponentService       = componentService;
     CountryOfOriginService = countryOfOriginService;
     SupplierService        = supplierService;
     CodeCnService          = codeCnService;
     SetService             = setService;
     ColorNameService       = colorNameService;
     SizeService            = sizeService;
 }
 public static Task <IEnumerable <TEntity> > FindAllAsync <TEntity, TOptions>(
     this ICrudService <TEntity, TOptions> service, Expression <Func <TEntity, bool> > predicate,
     object context = null)
     where TEntity : IEntity where TOptions : ICrudServiceOptions => Task.Run(() => service.FindAll(predicate,
                                                                                                    context == null
             ? DefaultCrudServiceOptions.Default <TOptions>()
                                                                                                    : DefaultCrudServiceOptions.FromContext <TOptions>(context)));
 public static Task <IEnumerable <TSelect> > GetAllAsync <TEntity, TOptions, TSelect>(
     this ICrudService <TEntity, TOptions> service,
     Expression <Func <TEntity, TSelect> > select, object context = null)
     where TEntity : IEntity where TOptions : ICrudServiceOptions => Task.Run(() => service.GetAll(select,
                                                                                                   context == null
             ? DefaultCrudServiceOptions.Default <TOptions>()
                                                                                                   : DefaultCrudServiceOptions.FromContext <TOptions>(context)));
Example #9
0
 public CreateModel(ICrudService <Conference> conferenceService, ICrudService <Venue> venueService)
 {
     _conferenceService = conferenceService;
     _venueService      = venueService;
     _conferenceService.Init(ModelTypes.Conference);
     _venueService.Init(ModelTypes.Venue);
 }
 public static IEnumerable <TSelect> FindAll <TEntity, TOptions, TSelect>(
     this ICrudService <TEntity, TOptions> service, Expression <Func <TEntity, bool> > predicate,
     Expression <Func <TEntity, TSelect> > select, object context = null)
     where TEntity : IEntity where TOptions : ICrudServiceOptions => service.FindAll(predicate, select,
                                                                                     context == null
             ? DefaultCrudServiceOptions.Default <TOptions>()
                                                                                     : DefaultCrudServiceOptions.FromContext <TOptions>(context));
Example #11
0
 public StudentGroupController(
     ICrudService <Student, Guid> studentCrudService,
     IGroupingService groupingService)
 {
     _studentCrudService = studentCrudService;
     _groupingService    = groupingService;
 }
Example #12
0
 public SubCategoryController(DataContext context, IMapper mapper, ICrudService <SubCategories> subCategoryService, ICustomFilterService <SubCategories> filterService)
 {
     this.context            = context;
     this.mapper             = mapper;
     this.subCategoryService = subCategoryService;
     this.filterService      = filterService;
 }
 public static IEnumerable <TEntity> FindAll <TEntity, TOptions>(
     this ICrudService <TEntity, TOptions> service, IEnumerable <TEntity> entities, object context = null)
     where TEntity : IEntity where TOptions : ICrudServiceOptions
 => service.FindAll(service.CreateEqualityComparerExpression(entities),
                    context == null
             ? DefaultCrudServiceOptions.Default <TOptions>()
                    : DefaultCrudServiceOptions.FromContext <TOptions>(context));
Example #14
0
 public TeamEditService(ICrudService <Team> teamService, ICrudService <Sport> sportService, ICrudService <League> leagueService, ICrudService <College> collegeService)
 {
     _teamService    = teamService;
     _sportService   = sportService;
     _leagueService  = leagueService;
     _collegeService = collegeService;
 }
Example #15
0
 public CreateFloorModel(ICrudService <Floor> fService)
 {
     floorService = fService;
     floorService.Init(ModelTypes.Floor);
     NewFloor = new Floor();
     done     = false;
 }
 public TransportController(
     ICrudService <Transport> transportCrudService,
     UserManager <IdentityUser> userManager)
 {
     _transportCrudService = transportCrudService;
     _userManager          = userManager;
 }
Example #17
0
 public InitializePaymentCommandHandler(
     ICrudService <CustomerOrder> customerOrderService,
     ICrudService <PaymentIn> paymentService,
     ICrudService <Store> storeService)
     : base(customerOrderService, paymentService, storeService)
 {
 }
Example #18
0
 public PromotionController(ICrudService <cm.Promotion> service, IMapper <cm.Promotion, PromotionInput> v, IUserService userService, IRepo <cm.ProductCategory> categoryService, IRepo <cm.Product> productService)
     : base(service, v)
 {
     this.userService     = userService;
     this.categoryService = categoryService;
     this.productService  = productService;
 }
Example #19
0
 public UserSeed(
     ICrudService <User, string> crudService,
     IReadService <Role, string> roleReadService)
     : base(crudService)
 {
     _roleReadService = roleReadService;
 }
Example #20
0
 public LoginServAcceptPlayer(IServiceProvider serviceProvider, Packet p, AuthThread login) : base(serviceProvider)
 {
     _accountCrudService = serviceProvider.GetService <ICrudService <AccountContract> >();
     _login     = login;
     _accountId = p.ReadInt();
     _key       = new SessionKey(p.ReadInt(), p.ReadInt(), p.ReadInt(), p.ReadInt());
 }
Example #21
0
 public DepartmentController(DataContext context, ICrudService <Department> departmentService, ICustomFilterService <Department> filterService, IMapper mapper)
 {
     this.context           = context;
     this.departmentService = departmentService;
     this.filterService     = filterService;
     this.mapper            = mapper;
 }
 public RentOrderDataController
 (
     ICrudService <RentOrder> crudService
 )
 {
     _crudService = crudService;
 }
 public GuideController(
     ICrudService <Guide> guideCrudService,
     UserManager <IdentityUser> userManager)
 {
     _guideCrudService = guideCrudService;
     _userManager      = userManager;
 }
Example #24
0
 public CharacterDelete(IServiceProvider serviceProvider, Packet packet, GameClient client) : base(serviceProvider)
 {
     _client               = client;
     _characterService     = serviceProvider.GetService <ICharacterService>();
     _characterCrudService = serviceProvider.GetService <ICrudService <CharacterContract> >();
     _charSlot             = packet.ReadInt();
 }
 public static TEntity Find <TEntity, TOptions>(
     this ICrudService <TEntity, TOptions> service, TEntity entity, object context = null)
     where TEntity : IEntity where TOptions : ICrudServiceOptions
 => service.Find(service.CreateEqualityComparerExpression(entity),
                 context == null
             ? DefaultCrudServiceOptions.Default <TOptions>()
                 : DefaultCrudServiceOptions.FromContext <TOptions>(context));
 public static TEntity Find <TEntity, TOptions>(
     this ICrudService <TEntity, TOptions> service, Expression <Func <TEntity, bool> > predicate,
     object context = null)
     where TEntity : IEntity where TOptions : ICrudServiceOptions => service.Find(predicate,
                                                                                  context == null
             ? DefaultCrudServiceOptions.Default <TOptions>()
                                                                                  : DefaultCrudServiceOptions.FromContext <TOptions>(context));
Example #27
0
 public StudentController(
     ICrudService <Student, Guid> studentCrudService,
     IStudentValidationService studentValidationService)
 {
     _studentCrudService       = studentCrudService;
     _studentValidationService = studentValidationService;
 }
        public static async Task <TModel> UpdateAndGetAsync <TModel>(this ICrudService <TModel> service, TModel data)
            where TModel : class, IBaseModel
        {
            await service.UpdateAsync(data);

            return(await service.GetByIdAsync(data.Id));
        }
Example #29
0
 public HomeController(ICrudService <RoomTypeDto> roomTypeCrudService, IUserService userService, ICrudService <ReservationDto> reservationCrudService, IMapper mapper)
 {
     _reservationCrudService = reservationCrudService;
     _roomTypeCrudService    = roomTypeCrudService;
     _userService            = userService;
     _mapper = mapper;
 }
Example #30
0
 public CrudServiceFacts(ServiceFixture fixture)
 {
     this.fixture        = fixture;
     this.service        = this.fixture.ServiceProvider.GetService <ICrudService <MockEntity> >();
     this.repositoryMock = this.fixture.ServiceProvider.GetService <Mock <IRepository <MockEntity> > >();
     this.unitOfWorkMock = this.fixture.ServiceProvider.GetService <Mock <IUnitOfWork> >();
 }
Example #31
0
        public ManagerServiceImpl(GhSrvContext context, ICrudService<File> fileCrudService,
			ICrudService<WorkingDir> workDirCrudService, ICrudService<Project> projectCrudService)
        {
            _context = context;
            _fileProvider = fileCrudService;
            _workDirProvider = workDirCrudService;
            _projectProvider = projectCrudService;
        }
Example #32
0
        public BaseService()
        {
            Provider = Provider.MsSql; //for test methods

            switch (Provider)
            {
                case Provider.MsSql:
                    DbMapper = new MsSqlServerMapper("DefaultConnection", new DefaultValueMapper());
                    break;
                case Provider.Postgres:
                    DbMapper = new PostgresMapper("Postgres", new DefaultValueMapper());
                    break;
                default:
                    throw new NotImplementedException();
            }

            CrudService = new CrudService(DbMapper);
            BaselineService = new BaselineService(DbMapper);
        }
 public ItemApiController(IOrderService orderService, ICrudService<Item> itemService)
 {
     _orderService = orderService;
     _itemService = itemService;
 }
 public HomeController(ICrudService<Category> s, ICrudService<Vendor> vs, ICrudService<Coupon> cs)
 {
     this.s = s;
     this.vs = vs;
     this.cs = cs;
 }
Example #35
0
 public UserController(ILoginService serv,ICrudService<User> t )
 {
     _service = serv;
     _testService = t;
 }
 public ListBindingController(ICrudService<Foobar> s, IBuilder<Foobar, FoobarInput> v)
 {
     this.s = s;
     this.v = v;
 }