gpt4 book ai didi

c# - 命名空间范围

转载 作者:行者123 更新时间:2023-12-04 17:03:07 25 4
gpt4 key购买 nike

我有一个名为 AuditLog 的类(class)内Domain.AuditLog命名空间。我想用AuditLog具有命名空间的另一个类中的类 ApplicationServices.AuditLog .喜欢:

using Domain.AuditLog;
namespace ApplicationServices.AuditLog
{
public interface IAuditLogService
{
List<AuditLog> GetAuditLogs();
}
}

它说“ApplicationServices.AuditLog”是一个“命名空间”,但像“类型”一样使用。我知道我可以使用以下方法解决这个问题:
namespace ApplicationServices.AuditLog
{
using Domain.AuditLog;
public interface IAuditLogService
{
List<AuditLog> GetAuditLogs();
}
}

是否有另一种引用方式 Domain.AuditLog ?

最佳答案

也许这可以帮助你:

using AL =  Domain.AuditLog.AuditLog;
namespace ApplicationServices.AuditLog
{
public interface IAuditLogService
{
List<AL> GetAuditLogs();
}
}

关于c# - 命名空间范围,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28413516/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com