Exemplo n.º 1
0
        public IActionResult GetNamed()
        {
            return(new WebApiGet <ReferenceDataMultiCollection>(this, async() =>
            {
                var coll = new ReferenceDataMultiCollection();
                var inactive = this.IncludeInactive();
                var refSelection = this.ReferenceDataSelection();

                var names = refSelection.Select(x => x.Key).ToArray();
                await ReferenceData.Current.PrefetchAsync(names);

                foreach (var q in refSelection)
                {
                    switch (q.Key)
                    {
                    case var s when string.Compare(s, nameof(ReferenceData.Gender), StringComparison.InvariantCultureIgnoreCase) == 0: coll.Add(new ReferenceDataMultiItem(nameof(ReferenceData.Gender), ReferenceDataFilter.ApplyFilter <RefDataNamespace.GenderCollection, RefDataNamespace.Gender>(ReferenceData.Current.Gender, q.Value, includeInactive: inactive))); break;

                    case var s when string.Compare(s, nameof(ReferenceData.EyeColor), StringComparison.InvariantCultureIgnoreCase) == 0: coll.Add(new ReferenceDataMultiItem(nameof(ReferenceData.EyeColor), ReferenceDataFilter.ApplyFilter <RefDataNamespace.EyeColorCollection, RefDataNamespace.EyeColor>(ReferenceData.Current.EyeColor, q.Value, includeInactive: inactive))); break;

                    case var s when string.Compare(s, nameof(ReferenceData.PowerSource), StringComparison.InvariantCultureIgnoreCase) == 0: coll.Add(new ReferenceDataMultiItem(nameof(ReferenceData.PowerSource), ReferenceDataFilter.ApplyFilter <RefDataNamespace.PowerSourceCollection, RefDataNamespace.PowerSource>(ReferenceData.Current.PowerSource, q.Value, includeInactive: inactive))); break;

                    case var s when string.Compare(s, nameof(ReferenceData.Company), StringComparison.InvariantCultureIgnoreCase) == 0: coll.Add(new ReferenceDataMultiItem(nameof(ReferenceData.Company), ReferenceDataFilter.ApplyFilter <RefDataNamespace.CompanyCollection, RefDataNamespace.Company>(ReferenceData.Current.Company, q.Value, includeInactive: inactive))); break;
                    }
                }

                return coll;
            }, operationType: OperationType.Read, statusCode: HttpStatusCode.OK, alternateStatusCode: HttpStatusCode.NoContent));
Exemplo n.º 2
0
 public IActionResult CompanyGetAll(List <string>?codes = default, string?text = default) => new WebApiGet <ReferenceDataFilterResult <RefDataNamespace.Company> >(this,
                                                                                                                                                                   () => Task.FromResult(ReferenceDataFilter.ApplyFilter <RefDataNamespace.CompanyCollection, RefDataNamespace.Company>(ReferenceData.Current.Company, codes, text, includeInactive: this.IncludeInactive())),
                                                                                                                                                                   operationType: OperationType.Read, statusCode: HttpStatusCode.OK, alternateStatusCode: HttpStatusCode.NoContent);
Exemplo n.º 3
0
        public IActionResult GetNamed()
        {
            return(new WebApiGet <ReferenceDataMultiCollection>(this, () =>
            {
                var coll = new ReferenceDataMultiCollection();
                var inactive = this.IncludeInactive();
                foreach (var q in this.ReferenceDataSelection())
                {
                    switch (q.Key)
                    {
                    case var s when string.Compare(s, ReferenceData.Property_Gender, StringComparison.InvariantCultureIgnoreCase) == 0: coll.Add(new ReferenceDataMultiItem(ReferenceData.Property_Gender, ReferenceDataFilter.ApplyFilter <RefDataNamespace.GenderCollection, RefDataNamespace.Gender>(ReferenceData.Current.Gender, q.Value, includeInactive: inactive))); break;

                    case var s when string.Compare(s, ReferenceData.Property_EyeColor, StringComparison.InvariantCultureIgnoreCase) == 0: coll.Add(new ReferenceDataMultiItem(ReferenceData.Property_EyeColor, ReferenceDataFilter.ApplyFilter <RefDataNamespace.EyeColorCollection, RefDataNamespace.EyeColor>(ReferenceData.Current.EyeColor, q.Value, includeInactive: inactive))); break;

                    case var s when string.Compare(s, ReferenceData.Property_PowerSource, StringComparison.InvariantCultureIgnoreCase) == 0: coll.Add(new ReferenceDataMultiItem(ReferenceData.Property_PowerSource, ReferenceDataFilter.ApplyFilter <RefDataNamespace.PowerSourceCollection, RefDataNamespace.PowerSource>(ReferenceData.Current.PowerSource, q.Value, includeInactive: inactive))); break;

                    case var s when string.Compare(s, ReferenceData.Property_Company, StringComparison.InvariantCultureIgnoreCase) == 0: coll.Add(new ReferenceDataMultiItem(ReferenceData.Property_Company, ReferenceDataFilter.ApplyFilter <RefDataNamespace.CompanyCollection, RefDataNamespace.Company>(ReferenceData.Current.Company, q.Value, includeInactive: inactive))); break;
                    }
                }

                return Task.FromResult(coll);
            }, operationType: OperationType.Read, statusCode: HttpStatusCode.OK, alternateStatusCode: HttpStatusCode.NoContent));
        }
        public IActionResult GetNamed()
        {
            return(new WebApiGet <ReferenceDataMultiCollection>(this, async() =>
            {
                var coll = new ReferenceDataMultiCollection();
                var inactive = this.IncludeInactive();
                var refSelection = this.ReferenceDataSelection();

                var names = refSelection.Select(x => x.Key).ToArray();
                await RefDataNamespace.ReferenceData.Current.PrefetchAsync(names).ConfigureAwait(false);

                foreach (var q in refSelection)
                {
                    switch (q.Key)
                    {
                    case var s when string.Compare(s, nameof(RefDataNamespace.Gender), StringComparison.InvariantCultureIgnoreCase) == 0: coll.Add(new ReferenceDataMultiItem(nameof(RefDataNamespace.Gender), ReferenceDataFilter.ApplyFilter <RefDataNamespace.GenderCollection, RefDataNamespace.Gender>(RefDataNamespace.ReferenceData.Current.Gender, q.Value, includeInactive: inactive))); break;

                    case var s when string.Compare(s, nameof(RefDataNamespace.TerminationReason), StringComparison.InvariantCultureIgnoreCase) == 0: coll.Add(new ReferenceDataMultiItem(nameof(RefDataNamespace.TerminationReason), ReferenceDataFilter.ApplyFilter <RefDataNamespace.TerminationReasonCollection, RefDataNamespace.TerminationReason>(RefDataNamespace.ReferenceData.Current.TerminationReason, q.Value, includeInactive: inactive))); break;

                    case var s when string.Compare(s, nameof(RefDataNamespace.RelationshipType), StringComparison.InvariantCultureIgnoreCase) == 0: coll.Add(new ReferenceDataMultiItem(nameof(RefDataNamespace.RelationshipType), ReferenceDataFilter.ApplyFilter <RefDataNamespace.RelationshipTypeCollection, RefDataNamespace.RelationshipType>(RefDataNamespace.ReferenceData.Current.RelationshipType, q.Value, includeInactive: inactive))); break;

                    case var s when string.Compare(s, nameof(RefDataNamespace.USState), StringComparison.InvariantCultureIgnoreCase) == 0: coll.Add(new ReferenceDataMultiItem(nameof(RefDataNamespace.USState), ReferenceDataFilter.ApplyFilter <RefDataNamespace.USStateCollection, RefDataNamespace.USState>(RefDataNamespace.ReferenceData.Current.USState, q.Value, includeInactive: inactive))); break;

                    case var s when string.Compare(s, nameof(RefDataNamespace.PerformanceOutcome), StringComparison.InvariantCultureIgnoreCase) == 0: coll.Add(new ReferenceDataMultiItem(nameof(RefDataNamespace.PerformanceOutcome), ReferenceDataFilter.ApplyFilter <RefDataNamespace.PerformanceOutcomeCollection, RefDataNamespace.PerformanceOutcome>(RefDataNamespace.ReferenceData.Current.PerformanceOutcome, q.Value, includeInactive: inactive))); break;
                    }
                }

                return coll;
            }, operationType: OperationType.Read, statusCode: HttpStatusCode.OK, alternateStatusCode: HttpStatusCode.NoContent));
Exemplo n.º 5
0
        public IActionResult GetNamed()
        {
            return(new WebApiGet <ReferenceDataMultiCollection>(this, async() =>
            {
                var coll = new ReferenceDataMultiCollection();
                var inactive = this.IncludeInactive();
                var refSelection = this.ReferenceDataSelection();

                var names = refSelection.Select(x => x.Key).ToArray();
                await ReferenceData.Current.PrefetchAsync(names);

                foreach (var q in refSelection)
                {
                    switch (q.Key)
                    {
                    case var s when string.Compare(s, nameof(ReferenceData.OpenStatus), StringComparison.InvariantCultureIgnoreCase) == 0: coll.Add(new ReferenceDataMultiItem(nameof(ReferenceData.OpenStatus), ReferenceDataFilter.ApplyFilter <RefDataNamespace.OpenStatusCollection, RefDataNamespace.OpenStatus>(ReferenceData.Current.OpenStatus, q.Value, includeInactive: inactive))); break;

                    case var s when string.Compare(s, nameof(ReferenceData.ProductCategory), StringComparison.InvariantCultureIgnoreCase) == 0: coll.Add(new ReferenceDataMultiItem(nameof(ReferenceData.ProductCategory), ReferenceDataFilter.ApplyFilter <RefDataNamespace.ProductCategoryCollection, RefDataNamespace.ProductCategory>(ReferenceData.Current.ProductCategory, q.Value, includeInactive: inactive))); break;

                    case var s when string.Compare(s, nameof(ReferenceData.AccountUType), StringComparison.InvariantCultureIgnoreCase) == 0: coll.Add(new ReferenceDataMultiItem(nameof(ReferenceData.AccountUType), ReferenceDataFilter.ApplyFilter <RefDataNamespace.AccountUTypeCollection, RefDataNamespace.AccountUType>(ReferenceData.Current.AccountUType, q.Value, includeInactive: inactive))); break;

                    case var s when string.Compare(s, nameof(ReferenceData.MaturityInstructions), StringComparison.InvariantCultureIgnoreCase) == 0: coll.Add(new ReferenceDataMultiItem(nameof(ReferenceData.MaturityInstructions), ReferenceDataFilter.ApplyFilter <RefDataNamespace.MaturityInstructionsCollection, RefDataNamespace.MaturityInstructions>(ReferenceData.Current.MaturityInstructions, q.Value, includeInactive: inactive))); break;

                    case var s when string.Compare(s, nameof(ReferenceData.TransactionType), StringComparison.InvariantCultureIgnoreCase) == 0: coll.Add(new ReferenceDataMultiItem(nameof(ReferenceData.TransactionType), ReferenceDataFilter.ApplyFilter <RefDataNamespace.TransactionTypeCollection, RefDataNamespace.TransactionType>(ReferenceData.Current.TransactionType, q.Value, includeInactive: inactive))); break;

                    case var s when string.Compare(s, nameof(ReferenceData.TransactionStatus), StringComparison.InvariantCultureIgnoreCase) == 0: coll.Add(new ReferenceDataMultiItem(nameof(ReferenceData.TransactionStatus), ReferenceDataFilter.ApplyFilter <RefDataNamespace.TransactionStatusCollection, RefDataNamespace.TransactionStatus>(ReferenceData.Current.TransactionStatus, q.Value, includeInactive: inactive))); break;
                    }
                }

                return coll;
            }, operationType: OperationType.Read, statusCode: HttpStatusCode.OK, alternateStatusCode: HttpStatusCode.NoContent));