-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IRedisClient add async method #148
Comments
IRedisClient 是社区 PR 的,不完整 |
var sb = new StringBuilder(@"using System;
using System.Collections.Generic;
using System.IO;
namespace FreeRedis
{
public partial interface IRedisClient
{
List<Func<IInterceptor>> Interceptors { get; }
event EventHandler<ConnectedEventArgs> Connected;
event EventHandler<NoticeEventArgs> Notice;
event EventHandler<UnavailableEventArgs> Unavailable;
");
var methods = typeof(RedisClient).GetMethods().OrderBy(a =>
a.ReturnType.IsAssignableFrom(typeof(Task)) ||
a.ReturnType.IsGenericType && a.ReturnType.GetGenericTypeDefinition() == typeof(Task<>)).ToArray();
foreach (var method in methods)
{
var mstr = method.DisplayCsharp(false);
mstr = mstr.Replace("public ", "")
.Replace("virtual ", "")
.Replace("System.IO.", "")
.Replace("System.Object.", "object")
.Replace("System.", "")
.Replace("Threading.Tasks.", "")
.Replace("Collections.Generic.", "")
.Replace("FreeRedis.Internal.", "")
.Replace("FreeRedis.", "")
.Replace("Boolean", "bool")
.Replace("String", "string")
.Replace("Int32", "int")
.Replace("Int64", "long")
.Replace("Decimal", "decimal");
mstr = Regex.Replace(mstr, @"Nullable<(\w+)>", "$1?");
// sb.Append($@"
//{method.ReturnType.DisplayCsharp(false)} {method.Name}({string.Join(", ", method.GetParameters().Select(a => a.ParameterType.DisplayCsharp(false) + " " + a.Name))})");
sb.Append($@"
{mstr};");
}
sb.Append(@"
}
}");
string redisInterface = sb.ToString(); |
2881099
added a commit
that referenced
this issue
May 31, 2023
v1.1.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
IRedisClient
doesn't have async methods witch are implemnted inRedisClient
, it makesIRedisClient
a little 鸡肋.The text was updated successfully, but these errors were encountered: