欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

基于nopCommerce的開(kāi)發(fā)框架 附源碼

 更新時(shí)間:2017年05月27日 11:32:16   作者:Mike  
這篇文章主要為大家詳細(xì)介紹了基于nopCommerce的開(kāi)發(fā)框架,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

  .NET的開(kāi)發(fā)人員應(yīng)該都知道這個(gè)大名鼎鼎的高質(zhì)量b2c開(kāi)源項(xiàng)目-nopCommerce,基于EntityFramework和MVC開(kāi)發(fā),擁有透明且結(jié)構(gòu)良好的解決方案,同時(shí)結(jié)合了開(kāi)源和商業(yè)軟件的最佳特性。官網(wǎng)地址:http://www.nopcommerce.com/,中文網(wǎng):http://www.nopcn.com/。下載后前后端展示如下。如果你還未了解過(guò)該項(xiàng)目,建議從官網(wǎng)下載代碼后在本地運(yùn)行查看效果。

  筆者使用該框架開(kāi)發(fā)過(guò)不少項(xiàng)目,總的來(lái)說(shuō),方便簡(jiǎn)潔,集成了.NET開(kāi)發(fā)許多常用的組件和功能。一直想將它分享出來(lái),但忙于工作而沒(méi)有達(dá)成,最近也是有時(shí)間來(lái)寫(xiě)這篇文章,本文將展示如何提取該源碼的精簡(jiǎn)框架并附上源碼(基于nopCommerce3.9版本)。如果你想了解框架結(jié)構(gòu),通過(guò)該框架來(lái)開(kāi)發(fā)項(xiàng)目,那么看一遍該文章是有價(jià)值的。前排提示:本框架源碼已上傳到GitHub:https://github.com/dreling8/Nop.Framework,有興趣的可以關(guān)注該項(xiàng)目,后續(xù)會(huì)將其它的一些通用模塊添加進(jìn)去,如用戶管理(IWorkContext 工作上下文)、插件功能、任務(wù)模塊(taskservice)、日志、緩存、本地化等。歡迎star給星星,你的支持是我的動(dòng)力!

一、了解項(xiàng)目結(jié)構(gòu)

  從項(xiàng)目結(jié)構(gòu)圖中我們也可以看出Nop的層次劃分非常清晰,先看我畫(huà)的層次圖

1. 展現(xiàn)層(Presentation)

  也可稱之為應(yīng)用層,只關(guān)注前端的整合,不涉及任何領(lǐng)域邏輯實(shí)現(xiàn)。這一層只做展現(xiàn),對(duì)我們框架來(lái)說(shuō)是可有可無(wú)的,因此提取框架時(shí)會(huì)將該層刪除。

2. 業(yè)務(wù)服務(wù)層(Nop.Services)

  整個(gè)系統(tǒng)的服務(wù)層,提供了對(duì)每個(gè)領(lǐng)域的接口和實(shí)現(xiàn)。這一層非常重要,提供了程序內(nèi)對(duì)展現(xiàn)層的接口服務(wù),不論展現(xiàn)層使用mvc,還是使用winform,異或是給app調(diào)用的webapi接口,都需要該層服務(wù)。但該層的服務(wù)主要是電商的一些服務(wù),對(duì)我們框架無(wú)用,因此在這個(gè)框架中會(huì)刪除所有服務(wù),只添加一個(gè)測(cè)試服務(wù)類和接口,應(yīng)用到項(xiàng)目中你應(yīng)該在該層添加接口和服務(wù)。

3. 數(shù)據(jù)層(Nop.Data)

  nop在數(shù)據(jù)層的倉(cāng)儲(chǔ)實(shí)現(xiàn)中使用了ef和sqlserver數(shù)據(jù)庫(kù),如果你想擴(kuò)展,也可以在該層使用其它的ORM映射庫(kù)和數(shù)據(jù)庫(kù)。這一層的大部分功能我們會(huì)在框架中將保留。

4. 基礎(chǔ)設(shè)施層(Nop.Core)

  包括緩存的實(shí)現(xiàn)、配置、領(lǐng)域模型等等。在框架中會(huì)保留一部分功能,并將Domain領(lǐng)域模型移出該層做單獨(dú)項(xiàng)目,為什么要這樣做,因?yàn)橥ǔG闆r下,Domain層的調(diào)整會(huì)比較多,所以我一般將Domain做單獨(dú)Project,當(dāng)然你也可以不調(diào)整,但框架做了該調(diào)整。

二、刪除與業(yè)務(wù)相關(guān)的代碼

  我們已經(jīng)對(duì)Nop的整個(gè)代碼層次結(jié)構(gòu)有了了解,基于以下兩點(diǎn)開(kāi)始修改項(xiàng)目源碼:1.框架足夠精簡(jiǎn),沒(méi)有任何電商業(yè)務(wù)。2.核心功能保留。建議在開(kāi)始前先copy一份源碼保留。

1. Test項(xiàng)目:Tests文件夾下面是測(cè)試項(xiàng)目,不是必需的,將它全部移除,開(kāi)發(fā)具體業(yè)務(wù),可以再單獨(dú)添加測(cè)試項(xiàng)目。由于是測(cè)試項(xiàng)目,刪除后整個(gè)項(xiàng)目還能跑起來(lái)。

2. Presentation展現(xiàn)層:這里的三個(gè)項(xiàng)目,分別是前臺(tái),后端和兩個(gè)項(xiàng)目共用的一些模塊。和測(cè)試項(xiàng)目一樣,這里我們也全部移除。

3. Plugin項(xiàng)目:插件項(xiàng)目,同1、2一樣,插件也不是必需的,移除所有的插件項(xiàng)目?,F(xiàn)在只剩下三個(gè)項(xiàng)目了(歡迎關(guān)注該項(xiàng)目的github,后續(xù)我會(huì)專門(mén)寫(xiě)篇文章介紹如何添加插件)。

  Nop.Services:業(yè)務(wù)服務(wù)層,這一層是程序集內(nèi)對(duì)外接口層,需要保留。刪除所有相關(guān)的業(yè)務(wù)服務(wù)類,其中日志、幫助、任務(wù)等跟系統(tǒng)相關(guān)的都刪除,目的是更好的展示整個(gè)系統(tǒng)的結(jié)構(gòu)。添加一個(gè)測(cè)試類,暫時(shí)什么都不寫(xiě)。

  Nop.Data:數(shù)據(jù)層項(xiàng)目。這層基本不做調(diào)整,只刪除EF的Mapping映射相關(guān)類。

  Nop.Core:基礎(chǔ)設(shè)施層。刪除電商業(yè)務(wù)相關(guān)的Domain,新建項(xiàng)目Nop.Domain。

  報(bào)錯(cuò)了,IWorkContext(工作上下文,用于獲取用戶信息等數(shù)據(jù))依賴Domain,刪除它。這個(gè)過(guò)程可能要?jiǎng)h除不少文件,直到項(xiàng)目不再報(bào)錯(cuò)。完成后我們的項(xiàng)目結(jié)構(gòu)如下,注意我們將Nop.Core中的實(shí)體基類移到了Nop.Domain中,到這一步,我們的基礎(chǔ)框架結(jié)構(gòu)已經(jīng)大致出來(lái)了。

三、添加數(shù)據(jù)庫(kù)、數(shù)據(jù)實(shí)體、映射、業(yè)務(wù)層代碼

1. 在本地Sqlserver中,新建數(shù)據(jù)庫(kù)MyProject,添加表Test。

USE [MyProject]
GO 

/****** Object: Table [dbo].[Test] Script Date: 05/24/2017 23:51:21 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON

GO

CREATE TABLE [dbo].[Test](
[Id] [int] NOT NULL,
[Name] [nvarchar](50) NOT NULL,
[Description] [nvarchar](200) NULL,
[CreateDate] [datetime] NULL,
CONSTRAINT [PK_Test] PRIMARY KEY CLUSTERED



[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

) ON [PRIMARY]

2. 添加實(shí)體類和映射。在Domain項(xiàng)目下面新建Test目錄,添加TestEntity。Data項(xiàng)目Mapping下新建Test目錄,添加EF映射類。

public class TestEntity: BaseEntity
{ 

public virtual string Name { get; set; } 
public virtual string Description { get; set; } 
public virtual DateTime? CreateDate { get; set; }

}

3. 添加業(yè)務(wù)層方法。

  在Nop.Services項(xiàng)目里,在我們之前添加的接口和類下面添加幾個(gè)常用的CURD方法,并實(shí)現(xiàn)它。這樣我們就已經(jīng)實(shí)現(xiàn)的業(yè)務(wù)層的代碼了。

/// <summary>

/// Test service interface

/// </summary>

public partial interface ITestService

{

/// <summary>
/// Gets all tests
/// </summary>
/// <returns>Tests</returns>

IList<TestEntity> GetAllTests();
 

/// <summary>
/// Gets a test
/// </summary>
/// <param name="testId">The test identifier</param>
/// <returns>Test</returns>

TestEntity GetTestById(int testId);

/// <summary>
/// Inserts a test
/// </summary>
/// <param name="test">Test</param>

void InsertTest(TestEntity test);

/// <summary>
/// Updates the test
/// </summary>
/// <param name="test">Test</param>

void UpdateTest(TestEntity test);

/// <summary>
/// Deletes a test
/// </summary>
/// <param name="test">Test</param>

void DeleteTest(TestEntity test);

}

/// <summary>
/// Test service
/// </summary>

public partial class TestService : ITestService

{

#region Constants
#endregion
#region Fields

 

private readonly IRepository<TestEntity> _testRepository;
#endregion
#region Ctor
public TestService(IRepository<TestEntity> testRepository)

{
this._testRepository = testRepository;

}
#endregion
#region Methods

 

/// <summary>
/// Gets all tests
/// </summary>
/// <returns>Tests</returns>

public virtual IList<TestEntity> GetAllTests()

{
return _testRepository.Table.Where(p => p.Name != null).ToList();

}

/// <summary>
/// Gets a topic
/// </summary>
/// <param name="testId">The test identifier</param>
/// <returns>Test</returns>

public virtual TestEntity GetTestById(int testId)
{

if (testId == 0)
return null;
return _testRepository.GetById(testId);

}

 

/// <summary>
/// Inserts a test
/// </summary>
/// <param name="test">Test</param>

public virtual void InsertTest(TestEntity test)
{
if (test == null)

throw new ArgumentNullException("test");
_testRepository.Insert(test);
 

}


/// <summary>
/// Updates the test
/// </summary>
/// <param name="test">Test</param>

public virtual void UpdateTest(TestEntity test)

{

if (test == null)
throw new ArgumentNullException("test");
_testRepository.Update(test);

}

/// <summary>
/// Deletes a test
/// </summary>
/// <param name="test">Test</param>

public virtual void DeleteTest(TestEntity test)

{

if (test == null)
throw new ArgumentNullException("test");
_testRepository.Delete(test);

}

#endregion

}

四、添加Presentation項(xiàng)目

  有了業(yè)務(wù)服務(wù),現(xiàn)在可以添加表現(xiàn)層項(xiàng)目來(lái)測(cè)試了。為什么不直接寫(xiě)測(cè)試項(xiàng)目?因?yàn)闇y(cè)試項(xiàng)目使用Mock模擬數(shù)據(jù),不能完整展示整個(gè)功能。

  1. 添加mvc模板項(xiàng)目,通過(guò)nuget引入Autofac和Autofac.Mvc5。

  2. 添加容器注冊(cè)類DependencyRegistrar,實(shí)現(xiàn)IDependencyRegistrar接口,這一步非常關(guān)鍵,我們將要用的接口和實(shí)現(xiàn)類注入到容器中。

/// <summary>
/// Dependency registrar
/// </summary>

public class DependencyRegistrar : IDependencyRegistrar

{

/// <summary>
/// Register services and interfaces
/// </summary>
/// <param name="builder">Container builder</param>
/// <param name="typeFinder">Type finder</param>
/// <param name="config">Config</param>

public virtual void Register(ContainerBuilder builder, ITypeFinder typeFinder, NopConfig config)

{

//注入ObjectContext

builder.Register<IDbContext>(c => new NopObjectContext("test")).InstancePerLifetimeScope();

// 注入ef到倉(cāng)儲(chǔ)
builder.RegisterGeneric(typeof(EfRepository<>)).As(typeof(IRepository<>)).InstancePerLifetimeScope();
// 注入Service及接口
builder.RegisterAssemblyTypes(typeof(TestService).Assembly)

.AsImplementedInterfaces()
.InstancePerLifetimeScope();

//注入controllers
builder.RegisterControllers(typeFinder.GetAssemblies().ToArray());

} 

/// <summary>
/// Order of this dependency registrar implementation
/// </summary>

public int Order

{

get { return 2; }

}

}

  3. 配置文件中添加數(shù)據(jù)庫(kù)訪問(wèn)節(jié)點(diǎn)

復(fù)制代碼 代碼如下:
<add name="test" connectionString="Data Source=.;Initial Catalog=MyProject;Integrated Security=False;Persist Security Info=False;User ID=sa;Password=sa1234" providerName="System.Data.SqlClient" />

  4. 應(yīng)用啟動(dòng)時(shí)添加初始化引擎上下文

  啟動(dòng)項(xiàng)目,這時(shí)NopEngine會(huì)報(bào)錯(cuò),因?yàn)槲覀儧](méi)有使用Nopconfig來(lái)配置項(xiàng)目,在RegisterDependencies方法中注釋NopConfig的注入,同時(shí)在Initialize過(guò)程中將相關(guān)代碼注釋。這樣就完成通過(guò)Autofac注入類到容器中。

public class MvcApplication : System.Web.HttpApplication
{

protected void Application_Start()
{

AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);

//引擎上下文初始化

EngineContext.Initialize(false);

}

}

//RegisterDependencies方法中注釋NopConfig的注入

//builder.RegisterInstance(config).As<NopConfig>().SingleInstance();

public void Initialize(NopConfig config)

{

//register dependencies
RegisterDependencies(config);

 

//沒(méi)有使用config,暫時(shí)注釋
//register mapper configurations
//RegisterMapperConfiguration(config);

 

//startup tasks 沒(méi)有啟用任務(wù),注釋
//if (!config.IgnoreStartupTasks)
//{
// RunStartupTasks();
//}

 

}

  5. 在controller添加測(cè)試代碼。將service添加到HomeController,在構(gòu)造函數(shù)中初始化。系統(tǒng)啟動(dòng)后會(huì)自動(dòng)注入實(shí)例。通過(guò)斷點(diǎn)我們看到,數(shù)據(jù)成功添加到了數(shù)據(jù)庫(kù)。

public class HomeController : Controller

{

public ITestService _testService;
public HomeController(

ITestService testService
)

{
_testService = testService;

}

public ActionResult Index()

{
var entity = new TestEntity()
{
CreateDate = DateTime.Now,
Description = "描述2",
Name = "測(cè)試數(shù)據(jù)2"

};

_testService.InsertTest(entity);

var tests = _testService.GetAllTests();

return View();

}

五、擴(kuò)展到Webapi、Winform、WPF

  現(xiàn)在再添加一個(gè)winform項(xiàng)目,同樣的步驟添加相關(guān)的代碼。在Winform中我們也能使用業(yè)務(wù)的服務(wù)了。

  1. 通過(guò)Nuget安裝autofac,entityframework, 添加項(xiàng)目Libraries下的引用。

  2. 添加依賴注冊(cè)類,因?yàn)槭莣inform項(xiàng)目,DependencyRegistrar這里需要做些調(diào)整,建議定義一個(gè)空接口IRegistrarForm,需要注入的Form實(shí)現(xiàn)IRegistrarForm。

/// <summary>
/// Dependency registrar
/// </summary>
public class DependencyRegistrar : IDependencyRegistrar

{

/// <summary>
/// Register services and interfaces
/// </summary>
/// <param name="builder">Container builder</param>
/// <param name="typeFinder">Type finder</param>
/// <param name="config">Config</param>

public virtual void Register(ContainerBuilder builder, ITypeFinder typeFinder, NopConfig config)

{

//注入ObjectContext

builder.Register<IDbContext>(c => new NopObjectContext("test")).InstancePerLifetimeScope();

 

// 注入ef到倉(cāng)儲(chǔ)
builder.RegisterGeneric(typeof(EfRepository<>)).As(typeof(IRepository<>)).InstancePerLifetimeScope();
// 注入Service及接口
builder.RegisterAssemblyTypes(typeof(TestService).Assembly)
.AsImplementedInterfaces()
.InstancePerLifetimeScope();

//注入controllers
//builder.RegisterControllers(typeFinder.GetAssemblies().ToArray());


//注入forms

var types = AppDomain.CurrentDomain.GetAssemblies()
.SelectMany(a => a.GetTypes().Where(t => t.GetInterfaces().Contains(typeof(IRegistrarForm))))
.ToArray();
foreach (var formtype in types)
{

builder.RegisterAssemblyTypes(formtype.Assembly);

}

 

}

 

/// <summary>
/// Order of this dependency registrar implementation
/// </summary>
public int Order

{

get { return 2; }

}

}

  3. 在啟動(dòng)時(shí)添加 EngineContext.Initialize(false),啟動(dòng)項(xiàng)目,報(bào)錯(cuò)了,因?yàn)閣inform不能執(zhí)行,對(duì)方法做些調(diào)整,添加一個(gè)參數(shù)isForm表示是否是winform,默認(rèn)為false。

/// <summary>
  /// Initializes a static instance of the Nop factory.
  /// </summary>
  /// <param name="forceRecreate">Creates a new factory instance even though the factory has been previously initialized.</param>
  /// <param name="isWinForm">是否客戶端程序</param>
  [MethodImpl(MethodImplOptions.Synchronized)]
  public static IEngine Initialize(bool forceRecreate,bool isWinForm = false)
  {
   if (Singleton<IEngine>.Instance == null || forceRecreate)
   {
    Singleton<IEngine>.Instance = new NopEngine();

    NopConfig config = null;
    if (!isWinForm)
    {
      config = ConfigurationManager.GetSection("NopConfig") as NopConfig;
    }
    else
    { 
     //如果使用winform,使用此代碼讀取配置初始化NopConfig
     var appSettings = ConfigurationManager.AppSettings;
     foreach (var key in appSettings.AllKeys)
     {
       
     }
    }

    
    Singleton<IEngine>.Instance.Initialize(config);
   }
   return Singleton<IEngine>.Instance;
  }
static class Program

{

/// <summary>
/// 應(yīng)用程序的主入口點(diǎn)。

/// </summary>
[STAThread]

static void Main()

{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
//Application.Run(new Form1());
//引擎上下文初始化

EngineContext.Initialize(false, true);
Application.Run(EngineContext.Current.Resolve<Form1>());

}

}

  4. From1中測(cè)試,成功調(diào)用了業(yè)務(wù)層的方法,這里我們并沒(méi)有實(shí)例化ITestService,而是交給依賴注入自動(dòng)實(shí)現(xiàn)。

public partial class Form1 : Form, IRegistrarForm

{
private ITestService _testService;

public Form1(
ITestService testService

)

{

InitializeComponent();

_testService = testService;

//如果不注入form可以使用EngineContext.Current.Resolve<ITestService>(); 得到實(shí)例

}

 

private void button1_Click(object sender, EventArgs e)
{
var tests = _testService.GetAllTests();

}

}

至此,基于Nop的精簡(jiǎn)開(kāi)發(fā)框架基本完成,如果你有興趣,建議在github關(guān)注該項(xiàng)目 :https://github.com/dreling8/Nop.Framework,歡迎star給星星,你的支持是我的動(dòng)力!

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • Winform控件SaveFileDialog用于保存文件

    Winform控件SaveFileDialog用于保存文件

    這篇文章主要為大家詳細(xì)介紹了Winform SaveFileDialog保存文件對(duì)話框的相關(guān)資料,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2017-03-03
  • Asp.net core中實(shí)現(xiàn)自動(dòng)更新的Option的方法示例

    Asp.net core中實(shí)現(xiàn)自動(dòng)更新的Option的方法示例

    這篇文章主要介紹了Asp.net core中實(shí)現(xiàn)自動(dòng)更新的Option的方法示例,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2019-03-03
  • .Net實(shí)現(xiàn)延遲隊(duì)列

    .Net實(shí)現(xiàn)延遲隊(duì)列

    這篇文章介紹了.Net實(shí)現(xiàn)延遲隊(duì)列的方法,文中通過(guò)示例代碼介紹的非常詳細(xì)。對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2022-07-07
  • ASP.NET動(dòng)態(tài)添加用戶控件的方法

    ASP.NET動(dòng)態(tài)添加用戶控件的方法

    這篇文章主要介紹了ASP.NET動(dòng)態(tài)添加用戶控件的方法,涉及asp.net用戶控件的動(dòng)態(tài)創(chuàng)建與使用技巧,需要的朋友可以參考下
    2015-07-07
  • ASP.NET MVC 文件上傳教程(一)

    ASP.NET MVC 文件上傳教程(一)

    這篇文章主要為大家詳細(xì)介紹了ASP.NET MVC 文件上傳教程第一篇,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2016-05-05
  • HttpWebRequest的常見(jiàn)錯(cuò)誤使用TcpClient可避免

    HttpWebRequest的常見(jiàn)錯(cuò)誤使用TcpClient可避免

    有時(shí)使用HttpWebRequest對(duì)象會(huì)出現(xiàn)錯(cuò)誤有三種服務(wù)器提交了協(xié)議沖突/基礎(chǔ)連接已經(jīng)關(guān)閉:連接被意外關(guān)閉/無(wú)法發(fā)送具有此謂詞類型的內(nèi)容正文,感興趣的朋友可以參考下本文
    2013-02-02
  • ASP.NET Core對(duì)不同類型的用戶進(jìn)行區(qū)別限流詳解

    ASP.NET Core對(duì)不同類型的用戶進(jìn)行區(qū)別限流詳解

    這篇文章主要介紹了ASP.NET Core對(duì)不同類型的用戶進(jìn)行區(qū)別限流的相關(guān)資料,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2021-02-02
  • asp.net(c#)限制用戶輸入規(guī)定的字符和數(shù)字的代碼

    asp.net(c#)限制用戶輸入規(guī)定的字符和數(shù)字的代碼

    這幾天在看到一個(gè)網(wǎng)站的注冊(cè)的時(shí)候,就只允許輸入規(guī)定的字符和數(shù)字。我就好奇的寫(xiě)了一個(gè)校驗(yàn)的代碼。呵呵 不知道對(duì)大家有沒(méi)有用。如果有用的話可以保存。沒(méi)有用就當(dāng)是看看以下了。
    2010-10-10
  • 基于Fiddler實(shí)現(xiàn)修改接口返回?cái)?shù)據(jù)進(jìn)行測(cè)試

    基于Fiddler實(shí)現(xiàn)修改接口返回?cái)?shù)據(jù)進(jìn)行測(cè)試

    這篇文章主要介紹了基于Fiddler實(shí)現(xiàn)修改接口返回?cái)?shù)據(jù)進(jìn)行測(cè)試,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下
    2020-08-08
  • C# 可空類型分析

    C# 可空類型分析

    可空類型是 System.Nullable 結(jié)構(gòu)的實(shí)例。可空類型可以表示其基礎(chǔ)值類型正常范圍內(nèi)的值,再加上一個(gè) null 值。
    2008-12-12

最新評(píng)論