public static void GetOrdersByCustomer(List <Order> orders, string methodName) { var result = new StringBuilder(); result.AppendLine("Q U E R Y 2"); foreach (var order in orders) { result.AppendLine($"Order ID: {order.OrderID} || Customer ID: {order.Customer.CustomerID} || Customer Name: {order.Customer.ContactName}"); } ResultNLogger.Info(result.ToString(), methodName); }
public static void GetCustomerAndOrdersByEmp(List <Order> orders, string methodName) { var result = new StringBuilder(); result.AppendLine("Q U E R Y 3"); foreach (var order in orders) { result.AppendLine($"Order ID: {order.OrderID} || Customer ID: {order.Customer.CustomerID} || Customer Name: {order.Customer.ContactName} || Employee ID: {order.Employee.EmployeeID} || Employee Name : {order.Employee.FirstName} {order.Employee.LastName} "); } ResultNLogger.Info(result.ToString(), methodName); }
// for L I N Q T O S Q L O B J E C T S public static void getCustomerData(List <Customer> customers, string methodName) { var result = new StringBuilder(); result.AppendLine("Q U E R Y 1"); foreach (var customer in customers) { result.AppendLine($"Customer ID: {customer.CustomerID} || Customer Name: {customer.ContactName}"); } ResultNLogger.Info(result.ToString(), methodName); }