Exemple #1
0
 public IActionResult GetAll()
 {
     return(new WebApiGet <PersonCollectionResult, PersonCollection, Person>(this, () => Factory.Create <IPersonManager>().GetAllAsync(WebApiQueryString.CreatePagingArgs(this)),
                                                                             operationType: OperationType.Read, statusCode: HttpStatusCode.OK, alternateStatusCode: HttpStatusCode.NoContent));
 }
Exemple #2
0
        public IActionResult GetByArgsWithEf(string?firstName = default, string?lastName = default, List <string>?genders = default)
        {
            var args = new PersonArgs {
                FirstName = firstName, LastName = lastName, GendersSids = genders
            };

            return(new WebApiGet <PersonCollectionResult, PersonCollection, Person>(this, () => Factory.Create <IPersonManager>().GetByArgsWithEfAsync(args, WebApiQueryString.CreatePagingArgs(this)),
                                                                                    operationType: OperationType.Read, statusCode: HttpStatusCode.OK, alternateStatusCode: HttpStatusCode.NoContent));
        }
 public IActionResult GetByEmployeeId(Guid employeeId)
 {
     return(new WebApiGet <PerformanceReviewCollectionResult, PerformanceReviewCollection, PerformanceReview>(this, () => _manager.GetByEmployeeIdAsync(employeeId, WebApiQueryString.CreatePagingArgs(this)),
                                                                                                              operationType: OperationType.Read, statusCode: HttpStatusCode.OK, alternateStatusCode: HttpStatusCode.NoContent));
 }
Exemple #4
0
        public IActionResult GetTransactions([FromRoute] string?accountId, [FromQuery(Name = "oldest-time")] DateTime?fromDate = default, [FromQuery(Name = "newest-time")] DateTime?toDate = default, [FromQuery(Name = "min-amount")] decimal?minAmount = default, [FromQuery(Name = "max-amount")] decimal?maxAmount = default, string?text = default)
        {
            var args = new TransactionArgs {
                FromDate = fromDate, ToDate = toDate, MinAmount = minAmount, MaxAmount = maxAmount, Text = text
            };

            return(new WebApiGet <TransactionCollectionResult, TransactionCollection, Transaction>(this, () => _manager.GetTransactionsAsync(accountId, args, WebApiQueryString.CreatePagingArgs(this)),
                                                                                                   operationType: OperationType.Read, statusCode: HttpStatusCode.OK, alternateStatusCode: HttpStatusCode.NoContent));
        }
        public IActionResult GetAccounts([FromQuery(Name = "product-category")] string?productCategory = default, [FromQuery(Name = "open-status")] string?openStatus = default, [FromQuery(Name = "is-owned")] bool?isOwned = default)
        {
            var args = new AccountArgs {
                ProductCategorySid = productCategory, OpenStatusSid = openStatus, IsOwned = isOwned
            };

            return(new WebApiGet <AccountCollectionResult, AccountCollection, Account>(this, () => Factory.Create <IAccountManager>().GetAccountsAsync(args, WebApiQueryString.CreatePagingArgs(this)),
                                                                                       operationType: OperationType.Read, statusCode: HttpStatusCode.OK, alternateStatusCode: HttpStatusCode.NoContent));
        }
Exemple #6
0
        public IActionResult GetByArgs([FromQuery(Name = "model-no")] string?modelNo = default, [FromQuery(Name = "serial-no")] string?serialNo = default, [FromQuery(Name = "power-sources")] List <string>?powerSources = default)
        {
            var args = new RobotArgs {
                ModelNo = modelNo, SerialNo = serialNo, PowerSourcesSids = powerSources
            };

            return(new WebApiGet <RobotCollectionResult, RobotCollection, Robot>(this, () => Factory.Create <IRobotManager>().GetByArgsAsync(args, WebApiQueryString.CreatePagingArgs(this)),
                                                                                 operationType: OperationType.Read, statusCode: HttpStatusCode.OK, alternateStatusCode: HttpStatusCode.NoContent));
        }
Exemple #7
0
        public IActionResult GetByArgs(string modelNo = default(string), string serialNo = default(string))
        {
            var args = new RobotArgs {
                ModelNo = modelNo, SerialNo = serialNo
            };

            return(new WebApiGet <RobotCollectionResult, RobotCollection, Robot>(this, () => Factory.Create <IRobotManager>().GetByArgsAsync(args, WebApiQueryString.CreatePagingArgs(this)),
                                                                                 operationType: OperationType.Read, statusCode: HttpStatusCode.OK, alternateStatusCode: HttpStatusCode.NoContent));
        }
        public IActionResult GetByArgs(string?company = default, string?description = default)
        {
            var args = new CustomerGroupArgs {
                CompanySid = company, Description = description
            };

            return(new WebApiGet <CustomerGroupCollectionResult, CustomerGroupCollection, CustomerGroup>(this, () => Factory.Create <ICustomerGroupManager>().GetByArgsAsync(args, WebApiQueryString.CreatePagingArgs(this)),
                                                                                                         operationType: OperationType.Read, statusCode: HttpStatusCode.OK, alternateStatusCode: HttpStatusCode.NoContent));
        }
Exemple #9
0
        public IActionResult GetByArgs(string?name = default, string?description = default)
        {
            var args = new ProductArgs {
                Name = name, Description = description
            };

            return(new WebApiGet <ProductCollectionResult, ProductCollection, Product>(this, () => _manager.GetByArgsAsync(args, WebApiQueryString.CreatePagingArgs(this)),
                                                                                       operationType: OperationType.Read, statusCode: HttpStatusCode.OK, alternateStatusCode: HttpStatusCode.NoContent));
        }
 public IActionResult GetByArgs(PersonArgs args)
 {
     return(new WebApiGet <PersonCollectionResult, PersonCollection, Person>(this, () => Manager.GetByArgsAsync(args, WebApiQueryString.CreatePagingArgs(this)),
                                                                             operationType: OperationType.Read, statusCode: HttpStatusCode.OK, alternateStatusCode: null));
 }
Exemple #11
0
        public IActionResult GetByArgs(string?firstName = default, string?lastName = default, List <string>?genders = default, DateTime?startFrom = default, DateTime?startTo = default, [FromQuery(Name = "includeTerminated")] bool?isIncludeTerminated = default)
        {
            var args = new EmployeeArgs {
                FirstName = firstName, LastName = lastName, GendersSids = genders, StartFrom = startFrom, StartTo = startTo, IsIncludeTerminated = isIncludeTerminated
            };

            return(new WebApiGet <EmployeeBaseCollectionResult, EmployeeBaseCollection, EmployeeBase>(this, () => _manager.GetByArgsAsync(args, WebApiQueryString.CreatePagingArgs(this)),
                                                                                                      operationType: OperationType.Read, statusCode: HttpStatusCode.OK, alternateStatusCode: HttpStatusCode.NoContent));
        }