Beispiel #1
0
        public static async Task <IReadOnlyCollection <DataProtectionKey> > GetFromDbAsync(string connectionString)
        {
            const string sql = "SELECT FriendlyName, Xml FROM dbo.DataProtectionKeys;";

            IEnumerable <dynamic> keys = await SqlRunner.QueryAsync(connectionString, sql);

            return(keys.Select(k => new DataProtectionKey((string)k.Xml)).ToList());
        }
 public static async Task <IEnumerable <ServiceRecipientEntity> > FetchAllServiceRecipients(string connectionString)
 {
     return(await SqlRunner.QueryAsync <ServiceRecipientEntity>(connectionString, @"SELECT
                   OdsCode,
                   Name,
                   OrderId
                  FROM dbo.ServiceRecipient;"));
 }
        public static async Task <IEnumerable <OrderItemRecipientEntity> > FetchByOrderId(
            string connectionString,
            int orderId)
        {
            const string sql = @"
                SELECT OrderId,
                       CatalogueItemId,
                       OdsCode,
                       Quantity,
                       DeliveryDate
                  FROM dbo.OrderItemRecipients
                 WHERE OrderId = @orderId;";

            return(await SqlRunner.QueryAsync <OrderItemRecipientEntity>(connectionString, sql, new { orderId }));
        }
        public static async Task <IEnumerable <OrderItemEntity> > FetchByOrderId(
            string connectionString,
            int orderId)
        {
            const string sql = @"
                SELECT OrderId,
                       CatalogueItemId,
                       ProvisioningTypeId AS ProvisioningType,
                       CataloguePriceTypeId AS CataloguePriceType,
                       PricingUnitName,
                       TimeUnitId AS TimeUnit,
                       CurrencyCode,
                       EstimationPeriodId AS EstimationPeriod,
                       PriceId,
                       Price,
                       Created,
                       LastUpdated
                  FROM dbo.OrderItem
                 WHERE OrderId = @orderId;";

            return(await SqlRunner.QueryAsync <OrderItemEntity>(connectionString, sql, new { orderId }));
        }
Beispiel #5
0
 public static async Task <IEnumerable <OrderItemEntity> > FetchAllAsync(string connectionString)
 {
     return(await SqlRunner.QueryAsync <OrderItemEntity>(connectionString, @"
         SELECT  OrderItemId,
                 OrderId,
                 CatalogueItemId,
                 CatalogueItemTypeId AS CatalogueItemType,
                 CatalogueItemName,
                 OdsCode,
                 ProvisioningTypeId AS ProvisioningType,
                 CataloguePriceTypeId AS CataloguePriceType,
                 PricingUnitTierName,
                 PricingUnitDescription,
                 TimeUnitId AS TimeUnit,
                 CurrencyCode,
                 Quantity,
                 EstimationPeriodId AS EstimationPeriod,
                 DeliveryDate,
                 Price,
                 Created,
                 LastUpdated
         FROM    dbo.OrderItem;"));
 }