12 2012 档案
摘要:Codefirst与Contractfirst相对应,先对代码进行编写,然后进行服务的定义!项目一:类库项目。先定义完相应的数据实体,然后定义服务。 [DataContract(Name = "People")] public class People//数据实体类 { private string _name; private int _age; private string _hometown; [DataMember(Name = "P_Name")] public string Name { get { return _name; } set {
阅读全文
摘要:项目一:类库项目。定义服务,code实现服务接口的类。[如上图的Service]namespace CodesContract{ [ServiceContract(Name = "CodeService", Namespace = "http://www.rxm.net")] public interface ICodeContract { [OperationContract] string GetName(string name); } public class CodeContract : ICodeContract { #region ICode
阅读全文

浙公网安备 33010602011771号