我有以下代码:
false
我已经在using Data;
using MyProject_API.Models.ViewModels;
using System.Linq;
using Utilities.Web.Authentication;
namespace MyProject_API.Services.EmailTemplates
{
/// <summary>
/// Defines the <see cref="EmailTemplatesSearch" />
/// </summary>
public class EmailTemplatesSearch
{
/// <summary>
/// Initializes a new instance of the <see cref="EmailTemplatesSearch"/> class.
/// </summary>
/// <param name="dataContext">The dataContext<see cref="DataContext"/></param>
/// <param name="user">The user<see cref="MyProjectIdentity"/></param>
public EmailTemplatesSearch(DataContext dataContext, MyProjectIdentity user)
{
_db = dataContext;
_user = user;
}
的帮助下清除了代码,并获得了以下代码:
CodeFormatter
如您所见,namespace MyProject_API.Services.EmailTemplates
{
using MyProject_API.Models.ViewModels;
using System.Linq;
using Utilities.Web.Authentication;
/// <summary>
/// Defines the <see cref="EmailTemplatesSearch" />
/// </summary>
public class EmailTemplatesSearch
{
/// <summary>
/// Initializes a new instance of the <see cref="EmailTemplatesSearch"/> class.
/// </summary>
/// <param name="dataContext">The dataContext<see cref="DataContext"/></param>
/// <param name="user">The user<see cref="MyProjectIdentity"/></param>
public EmailTemplatesSearch(DataContext dataContext, MyProjectIdentity user)
{
_db = dataContext;
_user = user;
}
失去了CodeFormatter
。我尝试将using Data;
添加到使用列表中,但是无法编译代码,找不到using Data;
名称空间中的DataContext
。我解决了将Data
从命名空间移到外部的问题,但看起来像拐杖。 using Data;
的定义类似于
DataContext
namespace Data
{
public class DataContext
失去CodeFormatter
?using Data;
在命名空间中不起作用?我搜索了类似的问题: LINQ to SQL Designer Bug,Should 'using' directives be inside or outside the namespace?等,但我仍然不明白如何解决我的问题