2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-06-26 21:13:13 +00:00

Generics workaround

This commit is contained in:
2022-06-05 02:06:59 +03:00
parent f1584b348d
commit 499f1e37d2
7 changed files with 89 additions and 78 deletions

View File

@ -19,6 +19,15 @@ public enum SizeEnum:short
XLarge = 22
}
public class SearchResults<T> : IRecord where T : IResource
{
[Public] public int Offset { get; set; }
[Public] public int Needed { get; set; }
[Public] public int Total { get; set; }
[Public] public T[] Results { get; set; }
}
[Resource]
public partial class MyService
{
@ -29,6 +38,12 @@ public partial class MyService
[Public] bool boolean = true;
[Public] bool[] booleanArray = new bool[] { true, false, true, false, true };
[Public]
public SearchResults<MyResource> GetRecords()
{
return new SearchResults<MyResource>() { Needed = 3, Offset = 10, Results = new MyResource[0], Total = 102 };
}
[Public] byte uInt8Test = 8;
[Public] byte? uInt8Null = null;
[Public] byte[] uInt8Array = new byte[] { 0, 1, 2, 3, 4, 5 };
@ -124,7 +139,7 @@ public partial class MyService
[Public] public IResource[] Resources { get; set; }
[Public]
public void Void() =>
public void Void() =>
Console.WriteLine("Void()");
[Public]
@ -159,7 +174,8 @@ public partial class MyService
[Public]
public (int, string, double, bool) GetTuple4(int a1, string a2, double a3, bool a4) => (a1, a2, a3, a4);
[Public] public MyRecord SendRecord(MyRecord record)
[Public]
public MyRecord SendRecord(MyRecord record)
{
Console.WriteLine(record.ToString());
return record;