CmdRS.cs 570 B

123456789101112131415161718192021222324
  1. using ProtoBuf;
  2. namespace Grpc.Extension.BaseService.Model
  3. {
  4. [ProtoContract(ImplicitFields = ImplicitFields.AllPublic)]
  5. public class CmdRS
  6. {
  7. [ProtoMember(1)]
  8. public bool Result { get; set; }
  9. [ProtoMember(2)]
  10. public string Message { get; set; }
  11. public static CmdRS Success(string msg = null)
  12. {
  13. return new CmdRS { Result = true, Message = msg };
  14. }
  15. public static CmdRS Fail(string msg)
  16. {
  17. return new CmdRS { Result = false, Message = msg };
  18. }
  19. }
  20. }