EntityHelper.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #region Apache License Version 2.0
  2. /*----------------------------------------------------------------
  3. Copyright 2019 Jeffrey Su & Suzhou Senparc Network Technology Co.,Ltd.
  4. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
  5. except in compliance with the License. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software distributed under the
  8. License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
  9. either express or implied. See the License for the specific language governing permissions
  10. and limitations under the License.
  11. Detail: https://github.com/JeffreySu/WeiXinMPSDK/blob/master/license.md
  12. ----------------------------------------------------------------*/
  13. #endregion Apache License Version 2.0
  14. /*----------------------------------------------------------------
  15. Copyright (C) 2019 Senparc
  16. 文件名:EntityHelper.cs
  17. 文件功能描述:实体与xml相互转换
  18. 创建标识:Senparc - 20150211
  19. 修改标识:Senparc - 20150303
  20. 修改描述:整理接口
  21. 修改标识:Senparc - 20170810
  22. 修改描述:v14.5.9 提取EntityHelper.FillClassValue()方法,优化FillEntityWithXml()方法
  23. 修改标识:Senparc - 20180901
  24. 修改描述:优化FillEntityWithXml()方法
  25. ----------------------------------------------------------------*/
  26. using System;
  27. using System.Collections.Generic;
  28. using System.Linq;
  29. using System.Reflection;
  30. using System.Xml.Linq;
  31. using Senparc.Weixin.Helpers;
  32. using Senparc.Weixin.MP.Entities;
  33. using Senparc.CO2NET.Helpers;
  34. using Senparc.CO2NET.Utilities;
  35. namespace Senparc.Weixin.MP.Helpers
  36. {
  37. /// <summary>
  38. /// 实体帮助类
  39. /// </summary>
  40. public static class EntityHelper
  41. {
  42. /// <summary>
  43. /// 检查是否是通过场景二维码扫入
  44. /// </summary>
  45. /// <param name="requestMessage"></param>
  46. /// <returns></returns>
  47. public static bool IsFromScene(this RequestMessageEvent_Subscribe requestMessage)
  48. {
  49. return !string.IsNullOrEmpty(requestMessage.EventKey);
  50. }
  51. }
  52. }