| | |
| | | { |
| | | private const string cacheKey = "XmlDoc"; |
| | | |
| | | public static XmlDoc XmlDoc { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 生成注释文档 |
| | | /// </summary> |
| | |
| | | } |
| | | } |
| | | |
| | | XmlDoc = xmlDoc; |
| | | |
| | | if (xmlDoc.Members.Any()) |
| | | { |
| | | var json = JsonConvert.SerializeObject(xmlDoc); |
| | |
| | | /// <returns></returns> |
| | | public static async Task<XmlDoc> GetXmlDocAsync() |
| | | { |
| | | XmlDoc xmlDoc = null; |
| | | var json = await App.GetService<IDistributedCache>().GetStringAsync(cacheKey); |
| | | if (!string.IsNullOrEmpty(json)) |
| | | if (XmlDoc == null) |
| | | { |
| | | xmlDoc = JsonConvert.DeserializeObject<XmlDoc>(json); |
| | | var json = await App.GetService<IDistributedCache>().GetStringAsync(cacheKey); |
| | | if (!string.IsNullOrEmpty(json)) |
| | | { |
| | | XmlDoc = JsonConvert.DeserializeObject<XmlDoc>(json); |
| | | } |
| | | if (XmlDoc == null) |
| | | { |
| | | XmlDoc = await BuildXmlDocAsync(); |
| | | } |
| | | } |
| | | if (xmlDoc == null) |
| | | { |
| | | xmlDoc = await BuildXmlDocAsync(); |
| | | } |
| | | return xmlDoc; |
| | | return XmlDoc; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | if (xmlDoc == null) |
| | | { |
| | | var json = await App.GetService<IDistributedCache>().GetStringAsync(cacheKey); |
| | | if (!string.IsNullOrEmpty(json)) |
| | | { |
| | | xmlDoc = JsonConvert.DeserializeObject<XmlDoc>(json); |
| | | } |
| | | } |
| | | if (xmlDoc == null) |
| | | { |
| | | xmlDoc = await BuildXmlDocAsync(); |
| | | xmlDoc = await GetXmlDocAsync(); |
| | | } |
| | | if (xmlDoc != null && memberInfo != null) |
| | | { |