添加了部分界面
This commit is contained in:
@@ -163,6 +163,37 @@ public class IDIS_DBContext:DbContext
|
||||
|
||||
return queries.Any();
|
||||
}
|
||||
public bool Register(string handle)
|
||||
{
|
||||
var handleExists = Values.Any(x => x.Handle == handle);
|
||||
if (handleExists)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var value = new IDIS_Value()
|
||||
{
|
||||
Handle = handle
|
||||
};
|
||||
Values.Add(value);
|
||||
SaveChanges();
|
||||
return true;
|
||||
}
|
||||
public void Register(string handle,string format, string value)
|
||||
{
|
||||
var handleExists = Values.Any(x => x.Handle == handle);
|
||||
if (!handleExists)
|
||||
{
|
||||
Register(handle);
|
||||
}
|
||||
var data = new IDIS_Data()
|
||||
{
|
||||
Handle = handle,
|
||||
Format = format,
|
||||
Value = value
|
||||
};
|
||||
Datas.Add(data);
|
||||
SaveChanges();
|
||||
}
|
||||
}
|
||||
// ReSharper disable once IdentifierTypo
|
||||
/// <summary>
|
||||
@@ -177,4 +208,7 @@ public partial class IDIS_Service:Node
|
||||
BIT4Log.Log<IDIS_Service>("已创建标识数据库");
|
||||
Context.Database.EnsureCreated();
|
||||
}
|
||||
|
||||
public bool Register(string handle) => Context.Register(handle);
|
||||
public void Register(string handle, string format, string value) => Context.Register(handle, format, value);
|
||||
}
|
Reference in New Issue
Block a user