Exemplo n.º 1
0
        public static Respone <TDestination> MyConversion <T, TDestination>(this IPResponse <T> s)
            where T : class, IConvertableToGenericModel <TDestination>
            where TDestination : class
        {
            var result = new Respone <TDestination>();

            result.Result  = s.data.ConvertToGenericModel();
            result.Success = s.success;
            result.Message = s.errorMessage;
            return(result);
        }
Exemplo n.º 2
0
        public GenericClassIssues()
        {
            var ipAccountStatus = new IPAccountStatus {
                hasPassword = false
            };
            var ipResult = new IPResponse <IPAccountStatus>
            {
                data         = ipAccountStatus,
                errorMessage = "no password provided",
                success      = false
            };

            Respone <AccountStatus> accountStatus = ipResult.MyConversion <IPAccountStatus, AccountStatus>();
        }