public OrderType(ICustomerService customerService, IOrderDetailViewService orderDetailViewService) { Name = "Siparisler"; Description = "Musteri siparisleri"; Field(_ => _.OrderID).Description("Siparis No"); Field(_ => _.CustomerID).Description("Musteri No"); Field(_ => _.EmployeeID, nullable: true).Description("Personel No"); Field(_ => _.OrderDate, nullable: true).Description("Siparis Tarihi"); Field(_ => _.RequiredDate, nullable: true).Description("Istenen Tarih"); Field(_ => _.ShippedDate, nullable: true).Description("Gönderilen Tarih"); Field(_ => _.ShipVia, nullable: true).Description("Gönderme Sekli"); Field(_ => _.Freight, nullable: true).Description("Nakliye"); Field(_ => _.ShipName).Description("Gonderen"); Field(_ => _.ShipAddress).Description("Gonderici Adresi"); Field(_ => _.ShipCity).Description("Sehir"); Field(_ => _.ShipRegion, nullable: true).Description("Bolge"); Field(_ => _.ShipPostalCode).Description("Posta Kodu"); Field(_ => _.ShipCountry).Description("Ulke"); Field <ListGraphType <OrderDetailViewType> >( "orderDetail", Description = "Siparis Detaylalrı", resolve: context => { return(orderDetailViewService.GetAll(_ => _.OrderID == context.Source.OrderID)); } ); Field <CustomerType>( "customer", Description = "Siparis veren müsteri", resolve: context => { return(customerService.Get(_ => _.CustomerID == context.Source.CustomerID)); } ); }
public ProductType(ICategoryService categoryService, ISupplierService supplierService, IOrderDetailViewService orderDetailViewService) { Name = "Urun"; Description = "Ürün kolonları"; Field(_ => _.ProductID).Description("Urun No"); Field(_ => _.ProductName).Description("Urun Adı"); Field(_ => _.SupplierID, nullable: true).Description("Tedarikci No"); Field(_ => _.CategoryID, nullable: true).Description("Kategori No"); Field(_ => _.QuantityPerUnit).Description("Birim miktarı"); Field(_ => _.UnitPrice, nullable: true).Description("Birim Fiyatı"); Field(_ => _.UnitsInStock, nullable: true, type: typeof(IntGraphType)).Description("Stok miktarı"); Field(_ => _.UnitsOnOrder, nullable: true, type: typeof(IntGraphType)).Description("Siparişteki miktarı"); Field(_ => _.ReorderLevel, nullable: true, type: typeof(IntGraphType)).Description("Yeniden sipariş seviyesi"); Field(_ => _.Discontinued, nullable: true).Description("Stoğu var mı?"); Field <CategoryType>( "category", Description = "Urunun bulunduğu kategori", resolve: context => { return(categoryService.Get(_ => _.CategoryID == context.Source.CategoryID)); }); Field <SupplierType>( "supplier", Description = "Tedarikci", resolve: context => { var supplier = supplierService.Get(_ => _.SupplierID == context.Source.SupplierID); return(supplier); } ); Field <ListGraphType <OrderDetailViewType> >( "orders", Description = "Ürüne Ait Siparişler", resolve: context => { return(orderDetailViewService.GetAll(_ => _.ProductID == context.Source.ProductID)); } ); }