public static void ShowIds <T>(this CropioApi cropio) where T : ICropioRegularObject { Console.WriteLine(CropioDataModel.Name <T>()); MassResponse <Int32> ids = cropio.GetObjectsIds <T>(); if (ids.Data == null) { Console.WriteLine("Data == null"); return; } Console.WriteLine(String.Join(", ", ids.Data.Select(x => x.ToString().PadLeft(8)))); }
public static void ShowObject <T>(this CropioApi cropio, Int32 objId) where T : ICropioRegularObject { Response <T> obj = cropio.GetObject <T>(objId); if (obj == null || obj.Data == null) { return; } Console.WriteLine("\n\n————— {0,6} ({1}) ——————————————————————————————————————", objId, CropioDataModel.Name <T>()); Console.WriteLine(obj.Data); }
public static void ShowObjects <T>(this CropioApi cropio, params Int32[] objIds) where T : ICropioRegularObject { MassResponse <T> result = cropio.GetObjects <T>(objIds); if (result.Data == null) { Console.WriteLine("Data == null"); return; } foreach (T obj in result.Data) { Console.WriteLine("\n\n————— {0,6} ({1}) ——————————————————————————————————————", obj.Id, CropioDataModel.Name <T>()); Console.WriteLine(obj); } }