コード例 #1
0
        private static string GetQuotaString()
        {
            var quota = QuotaWrapper.GetCurrent();

            using (var ms = new MemoryStream())
            {
                var serializer = new DataContractJsonSerializer(typeof(QuotaWrapper));
                serializer.WriteObject(ms, quota);
                ms.Seek(0, SeekOrigin.Begin);

                return(Encoding.UTF8.GetString(ms.GetBuffer(), 0, (int)ms.Length));
            }
        }
コード例 #2
0
 private static List <Quota> ToDomain(this QuotaWrapper value)
 {
     return(value?.Quota?.Select(x => x.ToDomain()).ToList());
 }
コード例 #3
0
 public List <Quota> ApiToDomain(QuotaWrapper value)
 {
     return(value?.Quota?.Select(ApiToDomain).ToList());
 }