Code Monkey home page Code Monkey logo

webapidemo's Introduction

.NET Web API 示例

这是一个极简框架,并非大而全,按需添加或移除功能

开发环境

  1. VS2022
  2. .NET 6

实现或使用的功能

1. Swagger配置

除了基本配置外,实现了按Tags分组并排序

2. 全局异常处理

3. 方法拦截器

在方法拦截器中实现了token验证以及计算并输出接口耗时

4. Token验证

实现了简单的token验证

5. 定时任务

集成了Quartz.NET定时任务

6. 数据库操作

使用的是基于Dapper的Dapper.LiteSql,实现了同时连接多个数据库

7. 接口参数校验

除了默认的校验方式外,使用了FluentValidation库对参数进行校验

8. 统一返回值格式

9. 依赖注入

基于Autofac库编写了ServiceFactory服务工厂类,实现了服务的自动注册、启动与停止

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.