1>grain的接口请不要定义属性。否则编译是不会通过的。

public interface ITokenInfo: IGrainWithStringKey
{
//string appid { get; set; }
//string appsercet { get; set; }
//string access_token { get; set; }
//string refresh_token { get; set; }
//long lastdatetime { get; set; }//100纳秒,当前天所在的时间
/// <summary>
/// 新增token
/// </summary>
/// <returns></returns>
//Task Add();
//Task UpdateToken();//更新token
Task UpdateToken(WXTokenInfo wXTokenInfo);
Task<WXTokenInfo> GetWXTokenInfo();
}

例如上面的注释掉的部分。是不能这样写的。会提示appid 方法必须要有Task。

2>在silo注入grain,

parts.AddApplicationPart(typeof(WXTokenInfoGrain).Assembly).WithReferences()

不是简单的注入IWxToken接口项目集就可以了。

上面这样写,才能自动生成代码。否则会提示没有代码生成成功的错误。

相关文章:

  • 2021-08-31
  • 2022-01-09
  • 2021-08-01
  • 2021-04-11
  • 2021-12-22
  • 2021-12-20
  • 2021-05-22
  • 2021-10-04
猜你喜欢
  • 2021-07-12
  • 2021-10-06
  • 2021-04-16
  • 2022-12-23
  • 2021-09-14
  • 2021-06-22
  • 2021-10-15
相关资源
相似解决方案