Files
COMCMS/COMCMS.Web/Common/JsonExtension.cs
T
2018-07-02 18:15:35 +08:00

17 lines
370 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace COMCMS.Web.Common
{
public static class JsonExtension
{
public static string ToJson<TEntity>(this TEntity entity) where TEntity : class
{
return JsonConvert.SerializeObject(entity);
}
}
}