【发布时间】:2013-03-30 04:04:24
【问题描述】:
我正在学习 MVC WebAPI,我正在学习一个教程,一切都很顺利,直到我看到以下内容:
namespace HelloWebAPI.Controllers
{
using HelloWebAPI.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
public class ProductsController : ApiController
{}
我们通常的做法是在开头添加resources\scope,如下所示:
using HelloWebAPI.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
namespace HelloWebAPI.Controllers
{
public class ProductsController : ApiController
{}
我的主管告诉我没关系,应该没问题,因为它是有关该主题的官方 MS 教程。
** 我想知道为什么这无关紧要,以便我更好地理解它? **
【问题讨论】:
标签: c# coding-style namespaces