Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
IoTSharp
IoTSharp
提交
02328d4f
IoTSharp
项目概览
IoTSharp
/
IoTSharp
10 个月 前同步成功
通知
15
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
IoTSharp
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
02328d4f
编写于
7月 31, 2020
作者:
麦壳饼
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove attribute data table ,
上级
8ddd6295
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
96 addition
and
61 deletion
+96
-61
IoTSharp/Controllers/DevicesController.cs
IoTSharp/Controllers/DevicesController.cs
+2
-2
IoTSharp/Data/ApplicationDbContext.cs
IoTSharp/Data/ApplicationDbContext.cs
+6
-14
IoTSharp/Data/AttributeData.cs
IoTSharp/Data/AttributeData.cs
+0
-13
IoTSharp/Data/DataStorage.cs
IoTSharp/Data/DataStorage.cs
+30
-1
IoTSharp/Data/TelemetryData.cs
IoTSharp/Data/TelemetryData.cs
+29
-2
IoTSharp/Extensions/DataExtension.cs
IoTSharp/Extensions/DataExtension.cs
+19
-17
IoTSharp/Extensions/DeviceExtension.cs
IoTSharp/Extensions/DeviceExtension.cs
+2
-2
IoTSharp/Handlers/MQTTServerHandler.cs
IoTSharp/Handlers/MQTTServerHandler.cs
+2
-2
IoTSharp/IoTSharp.xml
IoTSharp/IoTSharp.xml
+4
-6
IoTSharp/Jobs/PushData.cs
IoTSharp/Jobs/PushData.cs
+2
-2
未找到文件。
IoTSharp/Controllers/DevicesController.cs
浏览文件 @
02328d4f
...
...
@@ -428,7 +428,7 @@ namespace IoTSharp.Controllers
}
else
{
var
result
=
await
_context
.
SaveAsync
<
TelemetryLatest
,
TelemetryData
>(
telemetrys
,
device
,
DataSide
.
ClientSide
);
var
result
=
await
_context
.
SaveAsync
<
TelemetryLatest
>(
telemetrys
,
device
,
DataSide
.
ClientSide
);
return
Ok
(
new
ApiResult
<
Dic
>(
result
.
ret
>
0
?
ApiCode
.
Success
:
ApiCode
.
NothingToDo
,
result
.
ret
>
0
?
"OK"
:
"No Telemetry save"
,
result
.
exceptions
));
}
}
...
...
@@ -491,7 +491,7 @@ namespace IoTSharp.Controllers
}
else
{
var
result
=
await
_context
.
SaveAsync
<
AttributeLatest
,
AttributeData
>(
attributes
,
dev
,
DataSide
.
ClientSide
);
var
result
=
await
_context
.
SaveAsync
<
AttributeLatest
>(
attributes
,
dev
,
DataSide
.
ClientSide
);
return
Ok
(
new
ApiResult
<
Dic
>(
result
.
ret
>
0
?
ApiCode
.
Success
:
ApiCode
.
NothingToDo
,
result
.
ret
>
0
?
"OK"
:
"No Attribute save"
,
result
.
exceptions
));
}
}
...
...
IoTSharp/Data/ApplicationDbContext.cs
浏览文件 @
02328d4f
...
...
@@ -2,6 +2,7 @@
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.Extensions.Configuration
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
namespace
IoTSharp.Data
...
...
@@ -22,28 +23,27 @@ namespace IoTSharp.Data
protected
override
void
OnModelCreating
(
ModelBuilder
modelBuilder
)
{
base
.
OnModelCreating
(
modelBuilder
);
modelBuilder
.
Entity
<
TelemetryData
>().
HasKey
(
c
=>
new
{
c
.
DeviceId
,
c
.
KeyName
,
c
.
DateTime
});
modelBuilder
.
Entity
<
TelemetryData
>().
HasIndex
(
c
=>
new
{
c
.
DeviceId
,
c
.
KeyName
,
c
.
DateTime
});
modelBuilder
.
Entity
<
DataStorage
>().
HasKey
(
c
=>
new
{
c
.
Catalog
,
c
.
DeviceId
,
c
.
KeyName
,
c
.
DateTime
});
modelBuilder
.
Entity
<
DataStorage
>().
HasIndex
(
c
=>
c
.
Catalog
);
modelBuilder
.
Entity
<
DataStorage
>().
HasIndex
(
c
=>
new
{
c
.
Catalog
,
c
.
DeviceId
});
modelBuilder
.
Entity
<
DataStorage
>().
HasIndex
(
c
=>
new
{
c
.
Catalog
,
c
.
DeviceId
,
c
.
KeyName
}
);
modelBuilder
.
Entity
<
DataStorage
>().
HasIndex
(
c
=>
new
{
c
.
Catalog
,
c
.
DeviceId
,
c
.
KeyName
,
c
.
DateTime
});
modelBuilder
.
Entity
<
DataStorage
>()
.
HasDiscriminator
<
DataCatalog
>(
nameof
(
Data
.
DataStorage
.
Catalog
))
.
HasValue
<
DataStorage
>(
DataCatalog
.
None
)
.
HasValue
<
AttributeData
>(
DataCatalog
.
AttributeData
)
.
HasValue
<
AttributeLatest
>(
DataCatalog
.
AttributeLatest
)
.
HasValue
<
TelemetryData
>(
DataCatalog
.
TelemetryData
)
.
HasValue
<
TelemetryLatest
>(
DataCatalog
.
TelemetryLatest
);
modelBuilder
.
Entity
<
AttributeData
>().
HasDiscriminator
<
DataCatalog
>(
nameof
(
Data
.
DataStorage
.
Catalog
));
modelBuilder
.
Entity
<
AttributeLatest
>().
HasDiscriminator
<
DataCatalog
>(
nameof
(
Data
.
DataStorage
.
Catalog
));
modelBuilder
.
Entity
<
TelemetryData
>().
HasDiscriminator
<
DataCatalog
>(
nameof
(
Data
.
DataStorage
.
Catalog
));
modelBuilder
.
Entity
<
TelemetryLatest
>().
HasDiscriminator
<
DataCatalog
>(
nameof
(
Data
.
DataStorage
.
Catalog
));
modelBuilder
.
Entity
<
Device
>().
HasDiscriminator
<
DeviceType
>(
nameof
(
Data
.
Device
.
DeviceType
)).
HasValue
<
Gateway
>(
DeviceType
.
Gateway
).
HasValue
<
Device
>(
DeviceType
.
Device
);
modelBuilder
.
Entity
<
Gateway
>().
HasDiscriminator
<
DeviceType
>(
nameof
(
Data
.
Device
.
DeviceType
));
ForNpgsql
(
modelBuilder
);
}
private
void
ForNpgsql
(
ModelBuilder
modelBuilder
)
{
modelBuilder
.
Entity
<
TelemetryData
>()
...
...
@@ -61,14 +61,7 @@ namespace IoTSharp.Data
modelBuilder
.
Entity
<
AttributeLatest
>()
.
Property
(
b
=>
b
.
Value_XML
)
.
HasColumnType
(
"xml"
);
modelBuilder
.
Entity
<
AttributeData
>()
.
Property
(
b
=>
b
.
Value_Json
)
.
HasColumnType
(
"jsonb"
);
modelBuilder
.
Entity
<
AttributeData
>()
.
Property
(
b
=>
b
.
Value_XML
)
.
HasColumnType
(
"xml"
);
modelBuilder
.
Entity
<
TelemetryLatest
>()
.
Property
(
b
=>
b
.
Value_Json
)
...
...
@@ -95,7 +88,6 @@ namespace IoTSharp.Data
public
DbSet
<
TelemetryData
>
TelemetryData
{
get
;
set
;
}
public
DbSet
<
AttributeLatest
>
AttributeLatest
{
get
;
set
;
}
public
DbSet
<
DataStorage
>
DataStorage
{
get
;
set
;
}
public
DbSet
<
AttributeData
>
AttributeData
{
get
;
set
;
}
public
DbSet
<
TelemetryLatest
>
TelemetryLatest
{
get
;
set
;
}
public
DbSet
<
DeviceIdentity
>
DeviceIdentities
{
get
;
set
;
}
public
DbSet
<
AuditLog
>
AuditLog
{
get
;
set
;
}
...
...
IoTSharp/Data/AttributeData.cs
已删除
100644 → 0
浏览文件 @
8ddd6295
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel.DataAnnotations
;
using
System.Linq
;
using
System.Threading.Tasks
;
namespace
IoTSharp.Data
{
public
class
AttributeData
:
DataStorage
{
}
}
IoTSharp/Data/DataStorage.cs
浏览文件 @
02328d4f
...
...
@@ -5,7 +5,36 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace
IoTSharp.Data
{
public
class
DataStorage
public
interface
IDataStorage
{
[
Newtonsoft
.
Json
.
JsonIgnore
,
Column
(
Order
=
1
)]
public
Guid
DeviceId
{
get
;
set
;
}
[
Column
(
Order
=
2
)]
public
string
KeyName
{
get
;
set
;
}
[
Column
(
Order
=
3
,
TypeName
=
"timestamp with time zone"
)]
public
DateTime
DateTime
{
get
;
set
;
}
[
Column
(
Order
=
4
)]
[
EnumDataType
(
typeof
(
DataSide
))]
public
DataSide
DataSide
{
get
;
set
;
}
[
Column
(
Order
=
5
)]
[
EnumDataType
(
typeof
(
DataType
))]
public
DataType
Type
{
get
;
set
;
}
public
bool
Value_Boolean
{
get
;
set
;
}
public
string
Value_String
{
get
;
set
;
}
public
long
Value_Long
{
get
;
set
;
}
[
Column
(
TypeName
=
"timestamp with time zone"
)]
public
DateTime
Value_DateTime
{
get
;
set
;
}
public
double
Value_Double
{
get
;
set
;
}
public
string
Value_Json
{
get
;
set
;
}
public
string
Value_XML
{
get
;
set
;
}
public
byte
[]
Value_Binary
{
get
;
set
;
}
}
public
class
DataStorage
:
IDataStorage
{
[
EnumDataType
(
typeof
(
DataCatalog
)),
Column
(
Order
=
0
)]
public
DataCatalog
Catalog
{
get
;
set
;
}
...
...
IoTSharp/Data/TelemetryData.cs
浏览文件 @
02328d4f
...
...
@@ -8,8 +8,35 @@ using System.Threading.Tasks;
namespace
IoTSharp.Data
{
public
class
TelemetryData
:
DataStorage
public
class
TelemetryData
:
I
DataStorage
{
[
Newtonsoft
.
Json
.
JsonIgnore
,
Column
(
Order
=
1
)]
public
Guid
DeviceId
{
get
;
set
;
}
[
Column
(
Order
=
2
)]
public
string
KeyName
{
get
;
set
;
}
[
Column
(
Order
=
3
,
TypeName
=
"timestamp with time zone"
)]
public
DateTime
DateTime
{
get
;
set
;
}
[
Column
(
Order
=
4
)]
[
EnumDataType
(
typeof
(
DataSide
))]
public
DataSide
DataSide
{
get
;
set
;
}
=
DataSide
.
AnySide
;
[
Column
(
Order
=
5
)]
[
EnumDataType
(
typeof
(
DataType
))]
public
DataType
Type
{
get
;
set
;
}
public
bool
Value_Boolean
{
get
;
set
;
}
public
string
Value_String
{
get
;
set
;
}
public
long
Value_Long
{
get
;
set
;
}
[
Column
(
TypeName
=
"timestamp with time zone"
)]
public
DateTime
Value_DateTime
{
get
;
set
;
}
public
double
Value_Double
{
get
;
set
;
}
public
string
Value_Json
{
get
;
set
;
}
public
string
Value_XML
{
get
;
set
;
}
public
byte
[]
Value_Binary
{
get
;
set
;
}
}
}
IoTSharp/Extensions/DataExtension.cs
浏览文件 @
02328d4f
...
...
@@ -23,34 +23,31 @@ namespace IoTSharp.Extensions
return
(
ok
,
devices
.
FirstOrDefault
());
}
/// <summary>
/// Save Data to Device's
<typeparamref name="D"/>
and <typeparamref name="L"/>
/// Save Data to Device's and <typeparamref name="L"/>
/// </summary>
/// <typeparam name="L">Latest</typeparam>
/// <typeparam name="D">Data</typeparam>
/// <param name="data"></param>
/// <param name="device"></param>
/// <param name="dataSide"></param>
/// <param name="_context"></param>
/// <returns></returns>
internal
static
async
Task
<(
int
ret
,
Dic
exceptions
)>
SaveAsync
<
L
,
D
>(
this
ApplicationDbContext
_context
,
Dictionary
<
string
,
object
>
data
,
Device
device
,
DataSide
dataSide
)
where
L
:
DataStorage
,
new
()
where
D
:
DataStorage
,
new
()
internal
static
async
Task
<(
int
ret
,
Dic
exceptions
)>
SaveAsync
<
L
>(
this
ApplicationDbContext
_context
,
Dictionary
<
string
,
object
>
data
,
Device
device
,
DataSide
dataSide
)
where
L
:
DataStorage
,
new
()
{
Dic
exceptions
=
_context
.
PreparingData
<
L
,
D
>(
data
,
device
,
dataSide
);
Dic
exceptions
=
_context
.
PreparingData
<
L
>(
data
,
device
,
dataSide
);
int
ret
=
await
_context
.
SaveChangesAsync
();
return
(
ret
,
exceptions
);
}
/// <summary>
/// Preparing Data to Device's
<typeparamref name="D"/> and
<typeparamref name="L"/>
/// Preparing Data to Device's
<typeparamref name="L"/>
/// </summary>
/// <typeparam name="L"></typeparam>
/// <typeparam name="D"></typeparam>
/// <param name="_context"></param>
/// <param name="data"></param>
/// <param name="device"></param>
/// <param name="dataSide"></param>
/// <returns></returns>
internal
static
Dic
PreparingData
<
L
,
D
>(
this
ApplicationDbContext
_context
,
Dictionary
<
string
,
object
>
data
,
Device
device
,
DataSide
dataSide
)
internal
static
Dic
PreparingData
<
L
>(
this
ApplicationDbContext
_context
,
Dictionary
<
string
,
object
>
data
,
Device
device
,
DataSide
dataSide
)
where
L
:
DataStorage
,
new
()
where
D
:
DataStorage
,
new
()
{
Dic
exceptions
=
new
Dic
();
...
...
@@ -58,17 +55,26 @@ namespace IoTSharp.Extensions
{
try
{
var
tdata
=
new
D
()
{
DateTime
=
DateTime
.
Now
,
DeviceId
=
device
.
Id
,
KeyName
=
kp
.
Key
,
Value_DateTime
=
new
DateTime
(
1970
,
1
,
1
)
};
if
(
kp
.
Key
!=
null
)
{
tdata
.
FillKVToMe
(
kp
);
_context
.
Set
<
D
>().
Add
(
tdata
);
if
(
typeof
(
L
)
==
typeof
(
TelemetryLatest
))
{
var
tdata
=
new
TelemetryData
()
{
DateTime
=
DateTime
.
Now
,
DeviceId
=
device
.
Id
,
KeyName
=
kp
.
Key
,
Value_DateTime
=
new
DateTime
(
1970
,
1
,
1
)
};
tdata
.
FillKVToMe
(
kp
);
_context
.
Set
<
TelemetryData
>().
Add
(
tdata
);
}
var
tl
=
_context
.
Set
<
L
>().
Where
(
tx
=>
tx
.
DeviceId
==
device
.
Id
&&
tx
.
KeyName
==
kp
.
Key
&&
tx
.
DataSide
==
dataSide
);
if
(
tl
!=
null
)
{
_context
.
Set
<
L
>().
RemoveRange
(
tl
.
ToList
());
}
var
t2
=
new
L
()
{
DateTime
=
DateTime
.
Now
,
DeviceId
=
device
.
Id
,
KeyName
=
kp
.
Key
,
DataSide
=
dataSide
};
t2
.
Catalog
=
(
typeof
(
L
)
==
typeof
(
AttributeLatest
)
?
DataCatalog
.
AttributeLatest
:
((
typeof
(
L
)
==
typeof
(
TelemetryLatest
)
?
DataCatalog
.
TelemetryLatest
:
0
)));
t2
.
FillKVToMe
(
kp
);
_context
.
Set
<
L
>().
Add
(
t2
);
}
...
...
@@ -119,14 +125,10 @@ namespace IoTSharp.Extensions
}
return
obj
;
}
internal
static
void
FillKVToMe
<
T
>(
this
T
tdata
,
KeyValuePair
<
string
,
object
>
kp
)
where
T
:
DataStorage
internal
static
void
FillKVToMe
<
T
>(
this
T
tdata
,
KeyValuePair
<
string
,
object
>
kp
)
where
T
:
I
DataStorage
{
tdata
.
Catalog
=
typeof
(
T
)
==
typeof
(
AttributeData
)
?
DataCatalog
.
AttributeData
:
(
typeof
(
T
)
==
typeof
(
TelemetryData
)
?
DataCatalog
.
TelemetryData
:
((
typeof
(
T
)
==
typeof
(
AttributeLatest
)
?
DataCatalog
.
AttributeLatest
:
((
typeof
(
T
)
==
typeof
(
TelemetryLatest
)
?
DataCatalog
.
TelemetryLatest
:
0
)))));
;
switch
(
Type
.
GetTypeCode
(
kp
.
Value
.
GetType
()))
{
case
TypeCode
.
Boolean
:
...
...
IoTSharp/Extensions/DeviceExtension.cs
浏览文件 @
02328d4f
...
...
@@ -29,7 +29,7 @@ namespace IoTSharp.Extensions
});
Dictionary
<
string
,
object
>
pairs
=
new
Dictionary
<
string
,
object
>();
pairs
.
Add
(
"CreateDateTime"
,
DateTime
.
Now
);
_context
.
PreparingData
<
AttributeLatest
,
AttributeData
>(
pairs
,
device
,
DataSide
.
ServerSide
);
_context
.
PreparingData
<
AttributeLatest
>(
pairs
,
device
,
DataSide
.
ServerSide
);
}
}
public
static
void
AfterCreateDevice
(
this
ApplicationDbContext
_context
,
Device
device
,
string
username
,
string
password
)
...
...
@@ -49,7 +49,7 @@ namespace IoTSharp.Extensions
})
;
Dictionary
<
string
,
object
>
pairs
=
new
Dictionary
<
string
,
object
>();
pairs
.
Add
(
"CreateDateTime"
,
DateTime
.
Now
);
_context
.
PreparingData
<
AttributeLatest
,
AttributeData
>(
pairs
,
device
,
DataSide
.
ServerSide
);
_context
.
PreparingData
<
AttributeLatest
>(
pairs
,
device
,
DataSide
.
ServerSide
);
}
}
}
...
...
IoTSharp/Handlers/MQTTServerHandler.cs
浏览文件 @
02328d4f
...
...
@@ -152,13 +152,13 @@ namespace IoTSharp.Handlers
{
if
(
tpary
.
Length
>
5
&&
tpary
[
4
]
==
"xml"
)
{
var
qf
=
from
at
in
_dbContext
.
Attribute
Data
where
at
.
Type
==
DataType
.
XML
&&
at
.
KeyName
==
tpary
[
5
]
select
at
;
var
qf
=
from
at
in
_dbContext
.
Attribute
Latest
where
at
.
Type
==
DataType
.
XML
&&
at
.
KeyName
==
tpary
[
5
]
select
at
;
await
qf
.
LoadAsync
();
await
_serverEx
.
PublishAsync
(
$"/devices/me/attributes/response/
{
tpary
[
5
]}
"
,
qf
.
FirstOrDefault
()?.
Value_XML
);
}
else
if
(
tpary
.
Length
>
5
&&
tpary
[
4
]
==
"binary"
)
{
var
qf
=
from
at
in
_dbContext
.
Attribute
Data
where
at
.
Type
==
DataType
.
Binary
&&
at
.
KeyName
==
tpary
[
5
]
select
at
;
var
qf
=
from
at
in
_dbContext
.
Attribute
Latest
where
at
.
Type
==
DataType
.
Binary
&&
at
.
KeyName
==
tpary
[
5
]
select
at
;
await
qf
.
LoadAsync
();
await
_serverEx
.
PublishAsync
(
new
MqttApplicationMessage
()
{
Topic
=
$"/devices/me/attributes/response/
{
tpary
[
5
]}
"
,
Payload
=
qf
.
FirstOrDefault
()?.
Value_Binary
});
}
...
...
IoTSharp/IoTSharp.xml
浏览文件 @
02328d4f
...
...
@@ -24,24 +24,22 @@
https://github.com/chkr1011/MQTTnet/blob/master/Source/MQTTnet.Extensions.Rpc/MqttRpcClient.cs
</summary>
</member>
<member
name=
"M:IoTSharp.Extensions.DataExtension.SaveAsync``
2
(IoTSharp.Data.ApplicationDbContext,System.Collections.Generic.Dictionary{System.String,System.Object},IoTSharp.Data.Device,IoTSharp.Data.DataSide)"
>
<member
name=
"M:IoTSharp.Extensions.DataExtension.SaveAsync``
1
(IoTSharp.Data.ApplicationDbContext,System.Collections.Generic.Dictionary{System.String,System.Object},IoTSharp.Data.Device,IoTSharp.Data.DataSide)"
>
<summary>
Save Data to Device's
<typeparamref
name=
"D"
/>
and
<typeparamref
name=
"L"
/>
Save Data to Device's and
<typeparamref
name=
"L"
/>
</summary>
<typeparam
name=
"L"
>
Latest
</typeparam>
<typeparam
name=
"D"
>
Data
</typeparam>
<param
name=
"data"
></param>
<param
name=
"device"
></param>
<param
name=
"dataSide"
></param>
<param
name=
"_context"
></param>
<returns></returns>
</member>
<member
name=
"M:IoTSharp.Extensions.DataExtension.PreparingData``
2
(IoTSharp.Data.ApplicationDbContext,System.Collections.Generic.Dictionary{System.String,System.Object},IoTSharp.Data.Device,IoTSharp.Data.DataSide)"
>
<member
name=
"M:IoTSharp.Extensions.DataExtension.PreparingData``
1
(IoTSharp.Data.ApplicationDbContext,System.Collections.Generic.Dictionary{System.String,System.Object},IoTSharp.Data.Device,IoTSharp.Data.DataSide)"
>
<summary>
Preparing Data to Device's
<typeparamref
name=
"D"
/>
and
<typeparamref
name=
"L"
/>
Preparing Data to Device's
<typeparamref
name=
"L"
/>
</summary>
<typeparam
name=
"L"
></typeparam>
<typeparam
name=
"D"
></typeparam>
<param
name=
"_context"
></param>
<param
name=
"data"
></param>
<param
name=
"device"
></param>
...
...
IoTSharp/Jobs/PushData.cs
浏览文件 @
02328d4f
...
...
@@ -54,7 +54,7 @@ namespace IoTSharp.Jobs
{
case
DataCatalog
.
AttributeData
:
var
result2
=
await
_dbContext
.
SaveAsync
<
AttributeLatest
,
AttributeData
>(
msg
.
MsgBody
,
device
,
msg
.
DataSide
);
var
result2
=
await
_dbContext
.
SaveAsync
<
AttributeLatest
>(
msg
.
MsgBody
,
device
,
msg
.
DataSide
);
if
(
result2
.
exceptions
?.
Count
>
0
)
{
_logger
.
LogError
(
Newtonsoft
.
Json
.
JsonConvert
.
SerializeObject
(
msg
.
MsgBody
));
...
...
@@ -63,7 +63,7 @@ namespace IoTSharp.Jobs
break
;
case
DataCatalog
.
TelemetryData
:
var
result1
=
await
_dbContext
.
SaveAsync
<
TelemetryLatest
,
TelemetryData
>(
msg
.
MsgBody
,
device
,
msg
.
DataSide
);
var
result1
=
await
_dbContext
.
SaveAsync
<
TelemetryLatest
>(
msg
.
MsgBody
,
device
,
msg
.
DataSide
);
if
(
result1
.
exceptions
?.
Count
>
0
)
{
_logger
.
LogError
(
Newtonsoft
.
Json
.
JsonConvert
.
SerializeObject
(
msg
.
MsgBody
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录