大餐说它缺少界面的组件或参考

发布于 2025-02-11 19:24:26 字数 650 浏览 1 评论 0原文

我得到这个错误: 错误CS0246找不到类型或命名空间名称'ireimbursementTravelRcptService'(您是否缺少使用指令或汇编参考?)

我这样声明了我的类:

namespace Expense_Reimbursement.Services {
    public interface IReimbursementTravelRcptService
    {

    }

    public class ReimbursementTravelRcptService : IReimbursementTravelRcptService
    {
       
    } }

我在parterup.cs in Configureservices中的proceptup.cs in Configureservices: services.AddScoped< ireimbursementTravelRcptService,ReimbursementTravelRcptService>();

但是当我尝试注入它时,它给出了上述错误: @Inject IreimbursementTravelRcptService _irtsrsrservice;

我觉得我忘记了一些简单的东西,但我不知道我缺少什么。有什么想法吗?

谢谢

I get this error:
Error CS0246 The type or namespace name 'IReimbursementTravelRcptService' could not be found (are you missing a using directive or an assembly reference?)

I declare my class like this:

namespace Expense_Reimbursement.Services {
    public interface IReimbursementTravelRcptService
    {

    }

    public class ReimbursementTravelRcptService : IReimbursementTravelRcptService
    {
       
    } }

I have this in the Startup.cs in ConfigureServices:
services.AddScoped<IReimbursementTravelRcptService, ReimbursementTravelRcptService>();

But when I try to inject it it gives the error above:
@inject IReimbursementTravelRcptService _irtsrService;

I feel like I forgot something simple but I do not know what I am missing. Any ideas?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文