我在SQL Azure上安装了这个表
CREATE TABLE [dbo].[Sl](
[ID] [int] IDENTITY(1,1) NOT NULL,
[PublicId] [uniqueidentifier] NOT NULL,
CONSTRAINT [PrimaryKey_ba033f1f-ac1b-4616-8591-fcd47fe0f63d] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON),
CONSTRAINT [PublicId_UNIQUE] UNIQUE NONCLUSTERED
(
[PublicId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
Run Code Online (Sandbox Code Playgroud)
非常奇怪的是,ID会以意想不到的方式递增.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 …
Run Code Online (Sandbox Code Playgroud) 在我的代码中,我有一些信息消息,如logger.Log("dwewe")
和logger.Debug("ddddf")
.
问题是即使我在VS中调试,也没有写入Debug消息.
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
throwExceptions="true"
internalLogLevel="Trace"
internalLogFile="c:\nlog-app.log"
autoReload="false"
internalLogToConsole="true">
<!--
See http://nlog-project.org/wiki/Configuration_file
for information on customizing logging rules and outputs.
-->
<targets>
<!-- file targets -->
<target name="asyncFile" xsi:type="AsyncWrapper">
<target xsi:type="File" name="f" fileName="${basedir}/Logs/${shortdate}.log"
layout="${longdate} ${uppercase:${level}} ${message} ${event-context:item=error-source} ${event-context:item=error-class} ${event-context:item=error-method} ${event-context:item=error-message} ${event-context:item=inner-error-message} ${event-context:item=stack-trace}"/>
</target>
<!-- database targets -->
<target name="database" xsi:type="Database" keepConnection="true" useTransactions="true"
dbProvider="System.Data.SqlClient"
connectionString="data source=XXXXXX.database.windows.net;initial catalog=NLog;integrated security=false;persist security info=True;User ID=XXXXr;Password=BXXXX3"
commandText="INSERT INTO Logs(EventDateTime, EventLevel, UserName, MachineName, EventMessage, ErrorSource, ErrorClass, ErrorMethod, ErrorMessage, …
Run Code Online (Sandbox Code Playgroud) 我有这个名为1_method的文件
public class DerivedClass
{
[DataMember(Name="1_method")]
public virtual string FirstMethod { get; protected set; }
}
Run Code Online (Sandbox Code Playgroud)
当我反序列化json时,我需要它可以映射到各种名称.
我怎样才能实现类似下面的伪代码?
public class DerivedClass
{
[DataMember(Name="1_method",Name="2_method")]
public virtual string FirstMethod { get; protected set; }
}
Run Code Online (Sandbox Code Playgroud)
或者像这样:
public class DerivedClass
{
[DataMember(Name="1_method")]
[DataMember(Name="2_method")]
public virtual string FirstMethod { get; protected set; }
}
Run Code Online (Sandbox Code Playgroud)