摘要:
1.自定义日志 public class LogHelper { public static void DbInfo(string str) { string className = "方法名"; string path = "/DbInfo.txt"; if (string.IsNullOrEmp 阅读全文
摘要:
namespace TransactionsExamples { class TransactionsExample { static void StartOwnTransactionWithinContext() { using (var context = new BloggingContext()) ... 阅读全文
摘要:
1. Create an Existing Database CREATE TABLE [dbo].[Blogs] ( [BlogId] INT IDENTITY (1, 1) NOT NULL, [Name] NVARCHAR (200) NULL, [Url] NVARCHAR (200) NU 阅读全文
摘要:
1. Create the Application 1. Create the Application To keep things simple we’re going to build a basic console application that uses Code First to per 阅读全文
摘要:
https://msdn.microsoft.com/en-us/library/jj679962(v=vs.113).aspx 1.引用Entity Framework 2.Data Annotations 1)主键:[Key] 2)复合主键:多个[Key] 3)外键:[ForeignKey] [ 阅读全文