using Khd.Core.EntityFramework;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System.Linq;
using System.Windows;

namespace Khd.Core.Wpf.TaskForm
{
    /// <summary>
    /// RawMessageShow.xaml 的交互逻辑
    /// </summary>
    public partial class RawMessageShow : Window
    {
        private IHost host;
        private string locationCode;
        public RawMessageShow(IHost host, string locationCode)
        {
            InitializeComponent();
            this.locationCode = locationCode;
            this.host = host;
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                using var scope = host.Services.CreateScope();
                using var dbContext = scope.ServiceProvider.GetRequiredService<DefaultDbContext>();
                var wmsRawStocks = dbContext.WmsRawStock
                    .Where(t => t.locationCode == this.locationCode)
                    .GroupBy(t => t.locationCode)
                    .Select(t => new
                    {

                    })
                    .ToList();

            }
            catch
            {

            }
        }
    }
}
