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)); } }
private static List <Quota> ToDomain(this QuotaWrapper value) { return(value?.Quota?.Select(x => x.ToDomain()).ToList()); }
public List <Quota> ApiToDomain(QuotaWrapper value) { return(value?.Quota?.Select(ApiToDomain).ToList()); }