/LunaFramework

Primary LanguageVueMIT LicenseMIT

LunaFramework Build Status

状态
Luna Luna
Luna.Web Luna.Web
Luna.Dapper Luna
Luna.MongoDb Luna
Luna.Redis.AspNetCore Luna
Luna.Nlog.AspNetCore Luna

关于使用

  1. 在Main方法中新增代码
    LunaStarter.StartUp<LunaModule>()
    
  2. service写法
    public interface IDemoService
    {
    	string GetMessage();
    }
    
    public class DemoService :IDemoService, ILunaService
    {
    	public string GetMessage()
    	{
    		Logger.Info("GetMessage");
    		return "测试";
    	}
    }
    
    注意接口实现ILunaService才能被自动注册进IOC

关于web包使用

修改Startup代码

public void ConfigureServices(IServiceCollection services)
{
    ...
    services.AddLuna<SampleWebModule>();
}

public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
	...
	// 在UseMvc之前调用
	app.UseLuna();
	...
}

项目约定: 你的程序命名必须遵循aaa.bb.c的方式

 Demo.App        <- 应用程序入口
 Demo.Service    <- 服务层
 Demo.Entity     <- 实体层