GithubHelp home page GithubHelp logo

jangocheng / .net-core-development Goto Github PK

View Code? Open in Web Editor NEW

This project forked from amosli443061626/.net-core-development

0.0 1.0 0.0 4.16 MB

简易的开发框架(微服务) Asp.Net Core 2.0 + Mysql Orm + Ioc + Redis + AOP + RabbitMQ + Etcd + Autofac + Swagger

C# 99.94% Smalltalk 0.04% Dockerfile 0.02%

.net-core-development's Introduction

注意事项:

不允许Join查询,可以使用多查的方式  >> 分表分库

配置获取统一用 ConfigManagerConf.Get("**")   >>  扩展 etcd 动态更新

所有方法调用使用 IocContainer.Container.Get Ioc模式 >> AOP模式特性处理方法

日志记录使用 Log 方法   >>  扩展集中日志发送
初始化请看 Program.cs 文件

项目简介:

BusinessService:业务层(接口模式)
  • IStandard.Examples (接口层)
  • Standard.Examples (实现层)
DB(DB层)
  • DBContextEntity:qlServer/Mysql 模型生成层及默认DB初始化层
    +mysql文件夹下:EntityRobotForMysql.tt 保存(Ctrl+S)即生成数据库模型;EntityRobotForMysql.tt中LoadMySqlMetadata
    ("连接字符串") 配置生成模型的数据库连接字符串
Domain(Model层)
  • Domains:业务model
Infrastructure(基础服务)
  • CacheOperation:缓存处理
  • Checks:验证扩展
  • Configs:配置信息管理(使用Etcd)
  • Exceptions:异常
  • Extensions:帮助层,内含 等扩展
  • Ioc(控制反转):控制反转全局组件
  • BaseAspectAttribute:基础属性
  • CacheAttribute:缓存属性
  • LoggerAttribute:日志属性
  • TopSubscribeAttribute:订阅属性
  • IocContainer.RegisterAssembly(实现,接口):注册组件
    IocContainer.Container.Build()更新注册信息
    IonCOntainer.Get()配置组件
  • Logs:日志  >> NLog.config
  • Mappering:DTO数据转换
  • MessageMQ:消息队列 (Rabbitmq)
  • Pools:池化扩展
  • RedisHelper:redis操作
  • Pools:池化扩展
  • Result:统一结果返回类
  • RequestExtend:Htpp请求扩展
startups(服务启动层)
  • startup(示列)
  • Filters(拦截)
      LogFilterAttribute:日志拦截
所有的程序统一使用Ioc管理,要是程序生效,必须先到Program中注册

第一步:     使用ORM工具生成数据库模型

      DB -> EntityRobotForMysql.tt 中 LoadMySqlMetadata("连接字符串") 配置生成模型的数据库连接字符串,然后保存生成数据模型
    ORM 确定不能满足的情况下,请在DBContextEntity 项目中新建类,进行T-SQL编写,编写后调用;
    ORM: 使用方式请查看

第二步:Infrastructure(基础服务)->Configs->ConfigManagerConf 设置Mysql连接字符串
第三步: 编写业务及开放业务接口(方法统一返回参数:Result):


==

Docker + k8s + .Net Core + Etcd  -> Pass

.net-core-development's People

Contributors

amosli443061626 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.