当前位置: 首页>>代码示例>>C#>>正文


C# DataContract.ToDomainModel方法代码示例

本文整理汇总了C#中DataContract.ToDomainModel方法的典型用法代码示例。如果您正苦于以下问题:C# DataContract.ToDomainModel方法的具体用法?C# DataContract.ToDomainModel怎么用?C# DataContract.ToDomainModel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataContract的用法示例。


在下文中一共展示了DataContract.ToDomainModel方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Create

        public DataContract.EmployeeResponse Create(DataContract.Employee employee)
        {
            EmployeeResponse response = new EmployeeResponse();
            try
            {
                employee.JoiningDate = DateTime.UtcNow;
                var result = _manager.Create(employee.ToDomainModel());
                if (result == null)
                {
                    response.Status.StatusCode = "500";
                    response.Status.Message = "Error in creating employee";

                    return response;
                }
                response.Employee = result.ToDataContract();
                return response;
            }
            catch (Exception ex)
            {

                ExceptionPolicy.HandleException("service.policy", ex);
                response.Status.StatusCode = "500";
                response.Status.Message = "Error in creating Employee";
                return response;
            }
        }
开发者ID:tavisca-dhruvas,项目名称:Training,代码行数:26,代码来源:EmployeeManagementService.cs

示例2: AddRemark

        public DataContract.RemarkResponse AddRemark(string employeeId, DataContract.Remark remark)
        {
            RemarkResponse response = new RemarkResponse();
            try
            {
                var result = _manager.AddRemark(employeeId, remark.ToDomainModel());
                if (result == null)
                {
                    response.Status.StatusCode = "500";
                    response.Status.Message = "Error in creating employee";

                    return response;
                }
                response.Remark = result.ToDataContract();
                return response;
            }
            catch (Exception ex)
            {

                ExceptionPolicy.HandleException("service.policy", ex);
                response.Status.StatusCode = "500";
                response.Status.Message = "Error in creating Employee";
                return response;
            }
        }
开发者ID:tavisca-dhruvas,项目名称:Training,代码行数:25,代码来源:EmployeeManagementService.cs

示例3: Create

 public DataContract.Employee Create(DataContract.Employee employee)
 {
     try
     {
         var result = _manager.Create(employee.ToDomainModel());
         if (result == null) return null;
         return result.ToDataContract();
     }
     catch (Exception ex)
     {
         Exception newEx;
         var rethrow = ExceptionPolicy.HandleException("service.policy", ex, out newEx);
         throw newEx;
     }
 }
开发者ID:ytokas,项目名称:Tavisca-Training-WCF-EMS,代码行数:15,代码来源:EmployeeManagementService.cs

示例4: AddRemark

 public DataContract.Remark AddRemark(string employeeId, DataContract.Remark remark)
 {
     try
     {
         var result = _manager.AddRemark(employeeId, remark.ToDomainModel());
         if (result == null) return null;
         return result.ToDataContract();
     }
     catch (Exception ex)
     {
         Exception newEx;
         var rethrow = ExceptionPolicy.HandleException("service.policy", ex, out newEx);
         throw newEx;
     }
 }
开发者ID:ytokas,项目名称:Tavisca-Training-WCF-EMS,代码行数:15,代码来源:EmployeeManagementService.cs

示例5: Authenticate

 public DataContract.Employee Authenticate(DataContract.Credential credential)
 {
     try
     {
         var result = _manager.Authenticate(credential.ToDomainModel());
         if (result == null) return null;
         return result.ToDataContract();
     }
     catch (Exception ex)
     {
         var rethrow = ExceptionPolicy.HandleException("service.policy", ex);
         if (rethrow) throw;
         return null;
     }
 }
开发者ID:ytokas,项目名称:Tavisca-Training-WCF-EMS,代码行数:15,代码来源:IdentityService.cs


注:本文中的DataContract.ToDomainModel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。