/// <summary> /// 创建网络勾子推送内容日志 /// </summary> /// <param name="id">编号</param> /// <param name="whId">勾子编号</param> /// <param name="wHTypes">是为中转,否为非中转</param> /// <param name="requestTop">请求头部</param> /// <param name="content">推送内容</param> /// <param name="responseTop">响应头部</param> /// <param name="responseContent">响应内容</param> /// <param name="responseBody">响应结果</param> /// <param name="creationTime">创建时间</param> /// <param name="isDeleted">软删除,数据不会被物理删除</param> /// <param name="version">处理并发问题</param> public static WHLogs Create( Guid id, string whId, bool wHTypes, string requestTop, string content, string responseTop, string responseContent, string responseBody, DateTime?creationTime, bool isDeleted, Byte[] version ) { WHLogs result; result = new WHLogs(id); result.WhId = whId; result.WHTypes = wHTypes; result.RequestTop = requestTop; result.Content = content; result.ResponseTop = responseTop; result.ResponseContent = responseContent; result.ResponseBody = responseBody; result.CreationTime = creationTime; result.IsDeleted = isDeleted; result.Version = version; return(result); }
///// <summary> ///// 转换为网络勾子推送内容日志实体 ///// </summary> ///// <param name="dto">网络勾子推送内容日志数据传输对象</param> //public static WHLogs ToEntity3( this WHLogsDto dto ) { // if( dto == null ) // return new WHLogs(); // return WHLogsFactory.Create( // // // id : dto.Id.ToGuid(), // // // whId : dto.WhId, // // // wHTypes : dto.WHTypes, // // // requestTop : dto.RequestTop, // // // content : dto.Content, // // // responseTop : dto.ResponseTop, // // // responseContent : dto.ResponseContent, // // // responseBody : dto.ResponseBody, // // // creationTime : dto.CreationTime, // // // isDeleted : dto.IsDeleted, // // // version : dto.Version // // ); //} /// <summary> /// 转换为网络勾子推送内容日志数据传输对象 /// </summary> /// <param name="entity">网络勾子推送内容日志实体</param> public static WHLogsDto ToDto(this WHLogs entity) { if (entity == null) { return(new WHLogsDto()); } return(entity.MapTo <WHLogsDto>()); }
/// <summary> /// 转换为网络勾子推送内容日志持久化对象 /// </summary> /// <param name="entity">网络勾子推送内容日志实体</param> public static WHLogsPo ToPo(this WHLogs entity) { if (entity == null) { return(null); } return(entity.MapTo <WHLogsPo>()); }
/// <summary> /// 转换为网络勾子推送内容日志持久化对象 /// </summary> /// <param name="entity">网络勾子推送内容日志实体</param> private static WHLogsPo ToPo2(this WHLogs entity) { if (entity == null) { return(null); } return(new WHLogsPo { Id = entity.Id, WhId = entity.WhId, WHTypes = entity.WHTypes, RequestTop = entity.RequestTop, Content = entity.Content, ResponseTop = entity.ResponseTop, ResponseContent = entity.ResponseContent, ResponseBody = entity.ResponseBody, CreationTime = entity.CreationTime, IsDeleted = entity.IsDeleted, Version = entity.Version, }); }
/// <summary> /// 测试初始化 /// </summary> public WHLogsTest() { _wHLogs = Create(); }