Issue
Code backup
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
var prod = context.ProdBom
|
||||
.Join(context.ProdTable,
|
||||
pb => pb.ProdId,
|
||||
pt => pt.Id,
|
||||
(pb, pt) => new
|
||||
{
|
||||
ProdBom = pb,
|
||||
ProdTable = pt
|
||||
})
|
||||
.Where(x => x.ProdTable.ProjId == prodTable.ProjId
|
||||
&& x.ProdTable.SubProjId == prodTable.SubProjId
|
||||
&& x.ProdBom.ItemId == prodTable.ItemId
|
||||
&& x.ProdBom.ProdId == x.ProdTable.Id)
|
||||
.Select(x => x.ProdTable)
|
||||
.ToList();
|
||||
@@ -0,0 +1,28 @@
|
||||
//Simple function for create log message
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
public class Test
|
||||
{
|
||||
static void Log(string message,
|
||||
[CallerFilePath] string file = null,
|
||||
[CallerLineNumber] int line = 0)
|
||||
{
|
||||
Console.WriteLine("{0} ({1}): {2}", Path.GetFileName(file), line, message);
|
||||
}
|
||||
|
||||
static void Main()
|
||||
{
|
||||
Log("Hello, world");
|
||||
Log("This is the next line");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Output:
|
||||
|
||||
Test.cs (16): Hello, world
|
||||
Test.cs (17): This is the next line
|
||||
*/
|
||||
@@ -0,0 +1,22 @@
|
||||
using System.Net.NetworkInformation;
|
||||
|
||||
using var ping = new Ping();
|
||||
var host = "palsgnfrs01.pal.local";
|
||||
|
||||
while (true)
|
||||
{
|
||||
try
|
||||
{
|
||||
var reply = await ping.SendPingAsync(host, 3000);
|
||||
|
||||
if (reply.Status != IPStatus.Success)
|
||||
Console.WriteLine($"{DateTime.Now} | Get status {Enum.GetName(reply.Status)}");
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine($"{e.Message}\r\nAn error occurred while attempting to ping {host}");
|
||||
}
|
||||
|
||||
await Task.Delay(5000);
|
||||
}
|
||||
Reference in New Issue
Block a user