Last active
May 6, 2021 12:37
-
-
Save EngRajabi/e4cde87fafc28f474ad9cdb0a624655c to your computer and use it in GitHub Desktop.
TestService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface ITestService | |
{ | |
Result GetName(Param1 param); | |
} | |
public class TestService : ITestService | |
{ | |
public TestService() | |
{ | |
} | |
[CacheMethod(100)] | |
public Result GetName(Param1 param) | |
{ | |
return new Result{A = "A", Param1 = param}; | |
} | |
} | |
[Serializable] | |
[MessagePackObject] | |
public class Result | |
{ | |
[Key(0)] | |
public string A { get; set; } | |
[Key(1)] | |
public Param1 Param1 { get; set; } | |
[Key(3)] | |
public DateTime DateTime { get; set; } = DateTime.Now; | |
} | |
[Serializable] | |
[MessagePackObject] | |
public class Param1 | |
{ | |
[Key(0)] | |
public string Name { get; set; } | |
[Key(1)] | |
public Param2 Param2 { get; set; } | |
} | |
[Serializable] | |
[MessagePackObject] | |
public class Param2 | |
{ | |
[Key(0)] | |
public string Name { get; set; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment