public DeleteUserResponse DeleteUser(DeleteUserRequest request)
        {
            DeleteUserResponse        response = new DeleteUserResponse();
            SecurityBusinessComponent bc       = DependencyInjectionHelper.GetSecurityBusinessComponent();

            bc.DeleteUser(request.Id);
            return(response);
        }
Beispiel #2
0
        public MainWindow()
        {
            InitializeComponent();

            DependencyInjectionHelper.Resolve(this);

            DataContext = _viewModel;
        }
Beispiel #3
0
        public ODataCollectionSerializerTests()
        {
            _model      = SerializationTestsHelpers.SimpleCustomerOrderModel();
            _edmIntType = EdmCoreModel.Instance.GetPrimitive(EdmPrimitiveTypeKind.Int32, isNullable: false);

            _serializerProvider = DependencyInjectionHelper.GetDefaultODataSerializerProvider();
            _collectionType     = new EdmCollectionTypeReference(new EdmCollectionType(_edmIntType));
            _serializer         = new ODataCollectionSerializer(_serializerProvider);
        }
Beispiel #4
0
        public DeleteCustomerResponse DeleteCustomer(DeleteCustomerRequest request)
        {
            DeleteCustomerResponse    response = new DeleteCustomerResponse();
            CustomerBusinessComponent bc       = DependencyInjectionHelper.GetCustomerBusinessComponent();

            bc.DeleteCustomer(request.CustomerId);

            return(response);
        }
Beispiel #5
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddRazorPages();
            services.AddControllersWithViews();
            services.AddDbContext <JogadorContext>(options =>
                                                   options.UseSqlServer(Configuration.GetConnectionString("JogadorContext")));

            DependencyInjectionHelper.Register(services, Configuration);
        }
Beispiel #6
0
        public DeleteProductResponse DeleteProduct(DeleteProductRequest request)
        {
            DeleteProductResponse    response = new DeleteProductResponse();
            ProductBusinessComponent bc       = DependencyInjectionHelper.GetProductBusinessComponent();

            bc.DeleteProduct(request.Id);

            return(response);
        }
        public void CtorTakingModelAndConfigurationAndPathHandler_ThrowsArgumentNull_PathTemplateHandler()
        {
            HttpConfiguration configuration = DependencyInjectionHelper.CreateConfigurationWithRootContainer();

            Assert.ThrowsArgumentNull(
                () => new AttributeRoutingConvention(configuration: configuration,
                                                     routeName: RouteName, pathTemplateHandler: null),
                "pathTemplateHandler");
        }
Beispiel #8
0
        public GetOrderResponse GetOrderById(GetOrderRequest request)
        {
            GetOrderResponse       response = new GetOrderResponse();
            OrderBusinessComponent bc       = DependencyInjectionHelper.GetOrderBusinessComponent();

            response.Order = OrderAdapter.OrderToDto(bc.GetOrderById(request.Id));

            return(response);
        }
        public StoreSupplierResponse StoreSupplier(StoreSupplierRequest request)
        {
            StoreSupplierResponse     response = new StoreSupplierResponse();
            SupplierBusinessComponent bc       = DependencyInjectionHelper.GetSupplierBusinessComponent();
            Supplier supplier = SupplierAdapter.DtoToSupplier(request.Supplier);

            response.SupplierId = bc.StoreSupplier(supplier);

            return(response);
        }
Beispiel #10
0
        public static void Main(string[] args)
        {
            RegisterServices();
            var tasksHandler = DependencyInjectionHelper.InjectDependency <ITasksHandler>();

            CommandsHelper.AnalyseCommandArgs(args);
            tasksHandler.ExecuteTasks();
            NotificationsHelper.DisplayMessage(Messages.Finish);
            SystemsHelper.Sleep();
        }
        // This method gets called by the runtime. Use this method to add services to the container.
        // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddRazorPages();
            services.AddServerSideBlazor();
            services.AddDbContext <DbaContext>(options => options.UseSqlServer(Configuration["ConnectionStrings:DefaultConnection"]));

            //Configure dependecy injection per IClass and IRepository<T> convention
            DependencyInjectionHelper.GetServices("EventSubscription.DLSService")
            .ForEach(s => services.AddTransient(s.Item1, s.Item2));
        }
        public CreateSupplierWithLinkToProductResponse CreateNewSupplierWithLinkToProductById(CreateSupplierWithLinkToProductRequest request)
        {
            var bc = DependencyInjectionHelper.GetBusinessComponent <SupplierBusinessComponent>();

            var response = new CreateSupplierWithLinkToProductResponse();

            response.IsCreated = bc.CreateNewSupplierWithLinkToProductById(request.ProductId, request.SupplierName);

            return(response);
        }
Beispiel #13
0
        public AzureStorageProvider(string defaultContainer, string containers)
        {
            _storageAccountName      = Settings.AccountName;
            _storageAccountKey       = Settings.AccountKey;
            _storageDefaultContainer = defaultContainer;
            _storageContainers       = containers.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(s => s.Trim()).ToList();
            _logManager = DependencyInjectionHelper.ResolveService <ILogManager>();

            Initialize();
        }
Beispiel #14
0
        public GetRoleResponse GetRoleById(GetRoleRequest request)
        {
            GetRoleResponse           response = new GetRoleResponse();
            SecurityBusinessComponent bc       = DependencyInjectionHelper.GetSecurityBusinessComponent();

            Role role = bc.GetRoleById(request.RoleId);

            response.Role = SecurityAdapter.RoleToDTO(role);

            return(response);
        }
Beispiel #15
0
        public GetUsersResponse GetUsersByCriteria(GetUsersRequest request)
        {
            GetUsersResponse          response = new GetUsersResponse();
            SecurityBusinessComponent bc       = DependencyInjectionHelper.GetSecurityBusinessComponent();

            IQueryable <User> users = bc.GetUsersByCriteria(request.SearchType, request.Username, request.Rolename);

            response.Users = SecurityAdapter.UsersToDtos(users);

            return(response);
        }
Beispiel #16
0
        public GetUserResponse GetUserById(GetUserRequest request)
        {
            GetUserResponse           response = new GetUserResponse();
            SecurityBusinessComponent bc       = DependencyInjectionHelper.GetSecurityBusinessComponent();

            User user = bc.GetUserById(request.Id);

            response.User = SecurityAdapter.UserToDTO(user);

            return(response);
        }
Beispiel #17
0
        public GetCurrentUserResponse GetCurrentUser(GetCurrentUserRequest request)
        {
            GetCurrentUserResponse    response = new GetCurrentUserResponse();
            SecurityBusinessComponent bc       = DependencyInjectionHelper.GetSecurityBusinessComponent();

            User user = bc.GetUserByName(Thread.CurrentPrincipal.Identity.Name);

            response.User = SecurityAdapter.UserToCurrentUserDTO(user);

            return(response);
        }
        public GetSuppliersResponse GetSuppliersByProductId(GetSuppliersRequest request)
        {
            var bc        = DependencyInjectionHelper.GetBusinessComponent <SupplierBusinessComponent>();
            var suppliers = bc.GetSuppliersByProductId(request.ProductId);

            var response = new GetSuppliersResponse();

            response.Suppliers = SupplierAdapter.SuppliersToDtos(suppliers);

            return(response);
        }
Beispiel #19
0
        public GetSuppliersResponse GetSuppliersByCriteria(GetSuppliersRequest request)
        {
            GetSuppliersResponse      response = new GetSuppliersResponse();
            SupplierBusinessComponent bc       = DependencyInjectionHelper.GetSupplierBusinessComponent();

            IQueryable <Supplier> suppliers = bc.GetSuppliersByCriteria(request.SearchType, request.Name);

            response.Suppliers = SupplierAdapter.SuppliersToDtos(suppliers);

            return(response);
        }
Beispiel #20
0
        public GetSupplierResponse GetSupplierById(GetSupplierRequest request)
        {
            GetSupplierResponse       response = new GetSupplierResponse();
            SupplierBusinessComponent bc       = DependencyInjectionHelper.GetSupplierBusinessComponent();

            Supplier supplier = bc.GetSupplierById(request.Id);

            response.Supplier = SupplierAdapter.SupplierToDto(supplier);

            return(response);
        }
        public StoreSupplierResponse StoreSupplier(StoreSupplierRequeset request)
        {
            var response = new StoreSupplierResponse();
            var bc       = DependencyInjectionHelper.GetBusinessComponent <SupplierBusinessComponent>();

            var supplier = SupplierAdapter.DtoToSupplier(request.Supplier);

            response.Id = bc.StoreSupplier(supplier);

            return(response);
        }
Beispiel #22
0
        public StoreProductResponse StoreProduct(StoreProductRequest request)
        {
            StoreProductResponse     response = new StoreProductResponse();
            ProductBusinessComponent bc       = DependencyInjectionHelper.GetProductBusinessComponent();

            Product product = ProductAdapter.DtoToProduct(request.Product);

            response.Id = bc.StoreProduct(product);

            return(response);
        }
Beispiel #23
0
        public GetRolesResponse GetRolesByCriteria(GetRolesRequest request)
        {
            GetRolesResponse          response = new GetRolesResponse();
            SecurityBusinessComponent bc       = DependencyInjectionHelper.GetSecurityBusinessComponent();

            IQueryable <Role> roles = bc.GetRolesByCriteria(request.SearchType, request.Rolename);

            response.Roles = SecurityAdapter.RolesToDTOs(roles);

            return(response);
        }
Beispiel #24
0
        public GetCustomerResponse GetCustomerById(GetCustomerRequest request)
        {
            GetCustomerResponse       response = new GetCustomerResponse();
            CustomerBusinessComponent bc       = DependencyInjectionHelper.GetCustomerBusinessComponent();

            Customer customer = bc.GetCustomerById(request.CustomerId);

            response.Customer = CustomerAdapter.CustomerToDto(customer);

            return(response);
        }
Beispiel #25
0
        public static void InsertLog(string module, string function, LogType logType, string shortMsg, string fullMsg)
        {
            if (_logService == null)
            {
                _logService = DependencyInjectionHelper.GetService <LogService>();
            }

            string IpAddress = _logService.GetIPAddress();

            Task.Run(() => _logService.InsertLog(module, function, logType, shortMsg, fullMsg));
        }
Beispiel #26
0
        public healthcheck()
        {
            var logManager = DependencyInjectionHelper.ResolveService <ILogManager>();

            var config = new HealthCheckConfig
            {
                MongoDbConnectionString = ConfigurationManager.ConnectionStrings["analytics"].ConnectionString,
            };

            _healthCheckService = new BasicHealthCheckService(logManager, config);
        }
Beispiel #27
0
        public GetOrdersResponse GetOrdersByCriteria(GetOrdersRequest request)
        {
            GetOrdersResponse      response = new GetOrdersResponse();
            OrderBusinessComponent bc       = DependencyInjectionHelper.GetOrderBusinessComponent();

            IQueryable <Order> orders = bc.GetOrdersByCriteria(request.SearchType, request.CustomerId);

            response.Orders = OrderAdapter.OrdersToListDtos(orders);

            return(response);
        }
Beispiel #28
0
        public GetProductsResponse GetProductsByCriteria(GetProductsRequest request)
        {
            GetProductsResponse      response = new GetProductsResponse();
            ProductBusinessComponent bc       = DependencyInjectionHelper.GetProductBusinessComponent();

            IQueryable <Product> products = bc.GetProductsByCriteria(request.SearchType, request.Category, request.ProductName);

            response.Products = ProductAdapter.ProductsToDtos(products);

            return(response);
        }
Beispiel #29
0
        public GetCustomersResponse GetCustomersByCriteria(GetCustomersRequest request)
        {
            GetCustomersResponse      response = new GetCustomersResponse();
            CustomerBusinessComponent bc       = DependencyInjectionHelper.GetCustomerBusinessComponent();

            IQueryable <Customer> customers = bc.GetCustomersByCriteria(request.SearchType, request.City, request.CustomerName);

            response.Customers = CustomerAdapter.CustomersToDtos(customers);

            return(response);
        }
Beispiel #30
0
        public GetProductResponse GetProductById(GetProductRequest request)
        {
            GetProductResponse       response = new GetProductResponse();
            ProductBusinessComponent bc       = DependencyInjectionHelper.GetProductBusinessComponent();

            Product product = bc.GetProductById(request.Id);

            response.Product = ProductAdapter.ProductToDto(product);

            return(response);
        }