摘要: 1.扩展OperationBehaviorusing System;using System.Collections.Generic;using System.Linq;using System.Text;using System.ServiceModel.Description;using System.ServiceModel.Dispatcher;namespace Extend2{ [AttributeUsage(AttributeTargets.Method)] public class MyOperationBehavior:Attribute,IOperationBe... 阅读全文
posted @ 2013-11-11 18:11 feidaochuanqing 阅读(349) 评论(0) 推荐(0) 编辑
摘要: CREATE TABLE [dbo].[student_score]( [username] [nvarchar](20) NULL, [kemu] [nvarchar](20) NULL, [score] [int] NULL) ON [PRIMARY]1.sql中行列转置2.语句 select username, sum(case when kemu = '数学' then score else 0 end) as '数学', sum(case when kemu = '英语' then score else 0 end )as '英 阅读全文
posted @ 2013-11-06 15:39 feidaochuanqing 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 1.当你完成对对象的操作之后,实体框架应用 change tracker 去保持对你所做的跟踪。As you perform operations on your object instances, Entity Framework uses its changetracker to keep track of what you have done.2.增加eg:private static void AddMachuPicchu(){using (var context = new BreakAwayContext()){var machuPicchu = new Destination{N 阅读全文
posted @ 2013-10-31 19:20 feidaochuanqing 阅读(444) 评论(0) 推荐(0) 编辑
摘要: 1.查询privatestaticvoidFindGreatBarrierReef(){using(varcontext=newBreakAwayContext()){varquery=fromdincontext.Destinationswhered.Name=="GreatBarrierReef"selectd;varreef=query.SingleOrDefault();if(reef==null){Console.WriteLine("Can'tfindthereef!");}else{Console.WriteLine(reef.De 阅读全文
posted @ 2013-10-31 00:22 feidaochuanqing 阅读(339) 评论(0) 推荐(0) 编辑
摘要: 1.创建POCO public class Book { public int BookID { get; set; } public string BookName { get; set; } public byte[] RowVersion { get; set; } public Person Owner { get; set; } } public class Order { public string OrderID { get; set; } public string... 阅读全文
posted @ 2013-10-30 18:00 feidaochuanqing 阅读(280) 评论(0) 推荐(0) 编辑
摘要: ValidateService(project)using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace ValidateService{ public class CalculateService:ICalculate { public int Add(int a, int b) { return a + b; } }}using... 阅读全文
posted @ 2013-10-30 00:05 feidaochuanqing 阅读(333) 评论(0) 推荐(0) 编辑
摘要: 1.分析需求将需求切分为子系统2.将子系统划分为子模块3.定义各个子系统之间的接口4.定义各个子模块之间的接口5.开始各子模块的详细设计以及开发6.工序 6.1 对无风险的项目由项目核心人员开发样例 6.2 项目组一般人员针对每个子模块做各自实现,瀑布式的开发 6.3 项目核心人员公关技术难题,迭代式的6.4 对有风险的项留好接口 阅读全文
posted @ 2013-10-29 22:14 feidaochuanqing 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 步骤1 服务端契约使用强制事务传播流步骤2 服务端实现使用事务特性步骤3 host配置中使用支持事务传播的binding不受4 客户端采用TransactionScope经销商库存 提供创建的功能呢namespace GreatWall.VMS.DealerStock.ServiceContract{ [System.ServiceModel.ServiceContract] public interface IDealerStockService { [System.ServiceModel.OperationContract] [Transac... 阅读全文
posted @ 2013-10-23 09:18 feidaochuanqing 阅读(302) 评论(0) 推荐(0) 编辑
摘要: 使用DataTable.Merge:将两个表根据主键的列名进行合并如果无参数的话表示完全用新数据替换老数据,如果加参数为true表示不用新数据替换老数据DS1 ds = new DS1(); var drA = ds.DTA.NewDTARow(); drA.BeginEdit(); drA.PK = 1; drA.A = "aaa-1"; drA.B = "bbb-1"; ds.DTA.AddDTARow(drA); ds.AcceptCh... 阅读全文
posted @ 2013-10-16 16:17 feidaochuanqing 阅读(191) 评论(0) 推荐(0) 编辑
摘要: namespace ValidateService{ [ServiceContract] public interface IEchoClaims { [OperationContract] List Echo(); }}---------------server.Contract------------------------------- public class EchoClaims:IEchoClaims { public List Echo() { List claims = ... 阅读全文
posted @ 2013-10-16 00:16 feidaochuanqing 阅读(347) 评论(0) 推荐(0) 编辑