Objective
I've been diving in the blog park for two or three years, and I've seen a lot of great God articles here, and I've learned a lot of things. It can be said that I learned from the blog Garden Nutrition growth.
Think that year, I also take 10 g of the spirit of food from a blog park big God there for a set of development framework, formally embarked on the development of the road, to later become the main development, and then to the project manager then successfully won the artist, also is the pinnacle of life.
Only take, do not share is selfish, we are so selfish and how to do technical exchanges, talking about sharing the first thought is my 120G of spiritual food, but share this seems to be a bit of legal risk, so I put these years in the. NET development career in the set of framework to share to everyone.
Morning sent a blog, a moment to let the administrator took off, here I explained that there is no advertising to promote the meaning, I will not put any promotion information, not that necessary, the house, car, sister have, in a good unit on the class, or not this bambo to do what open source framework, the purpose is to have, Just come out and put a force in front of the novice. Let's go to the code to see, if there is a little bit of advertising suspect author my small JJ automatically shortened by one centimeter.
Talk less, first introduce the development framework.
Frame name: Nfine.framwork, great frame, good frame
Framework usage scenarios: OA, ERP, BPM, CRM, WMS, TMS, MIS and other business management systems and backend systems
Framework Solutions:
Solution Brief:
1, Nfine.code Bottom core class (not involved in development, can be Yi into DLLs provided).
2, Nfine.data data layer (not involved in development, can be Yi into DLLs provided).
3, nfine.application application (somewhat similar to the business Logic layer)
4, nfine.domain field layer.
5, nfine.mapping database mapping.
6, nfine.repository data access.
7, Nfine.web front view and controller.
The main use of the framework technology:
JS frame: jquery-2.1.1, bootstrap.js, jquery UI
CSS framework: Bootstrap v3.3.4 (Stable is the background, UI aspects according to the needs of upgrading their own bar).
Client-side validation: JQuery Validation Plugin 1.9.0.
Online Editor: CKEditor, Simditor
Upload file: uploadify v3.2.1
Dynamic tab: Jerichotab (self-improvement)
Data table: Jqgrid, Bootstrap Talbe
dialog box: layer-v2.3
Drop-down selection box: JQuery Select2
Tree structure controls: jquery Ztree, jquery wdtree
Page layout: Jquery.layout.js 1.4.4
Chart plugins: Echarts, Highcharts
Date control: My97datepicker
Core framework: ASP. NET MVC5, WEB API
Persistence Layer Framework: EntityFramework 6.0
Scheduled Tasks: Quartz.net components
Security Support: Filters, SQL injection, request forgery
Server-side validation: Entity model validation, self-encapsulation validator
Caching framework: Microsoft comes with cache, Redis
Log management: log4net, login log, operation log
Tool class: Npoi, Newtonsoft.json, verification code, rich public similar
Framework Code Style:
Database, Warehouse code
1 using Nfine.code; 2 using System; 3 using System.Collections.Generic; 4 using System.Data.Common; 5 using System.Linq; 6 using System.Linq.Expressions; 7 8 Namespace Nfine.data 9//<summary>11///Warehousing interface///</SUMMARY>13//<typeparam Name= "TEntity" > Entity type </typeparam>14 public interface irepositorybase<tentity> where Tentity:class,new ( Insert (TEntity entity), + int insert (list<tentity> entitys), + int Update (TE ntity entity); int Delete (TEntity entity); int delete (expression<func<tentity, bool>> pred icate); TEntity findentity (object keyValue); TEntity findentity (Expression<func<tentity, Bool> ;> predicate), iqueryable<tentity> IQueryable (), iqueryable<tentity> IQueryable (Express Ion<func<tentity, bool>> predicate); list<tentity> findlist (String strsql); 26List<tentity> findlist (String strSQL, dbparameter[] dbparameter); list<tentity> FindList (Pagination pagination); list<tentity> findlist (expression<func<tentity, bool>> predicate, pagination Pagi Nation); 29}30}
Using nfine.code;using system;using system.collections.generic;using system.data.common;using System.Data.Entity; Using system.linq;using system.linq.expressions;using system.reflection;using System.Text.RegularExpressions; namespace nfine.data{//<summary>///Warehousing implementation//</summary>//<typeparam name= "TEntity" >&L T;/typeparam> public class repositorybase<tentity>: irepositorybase<tentity> where Tentity:class,new ( {public Nfinedbcontext DbContext = new Nfinedbcontext (); public int Insert (TEntity entity) {DbContext. Entry<tentity> (entity). state = entitystate.added; Return DbContext. SaveChanges (); } public int Insert (list<tentity> entitys) {foreach (var entity in Entitys) { DbContext. Entry<tentity> (entity). state = entitystate.added; } return DbContext. SaveChanges (); } public int upDate (TEntity entity) {DbContext. Set<tentity> (). Attach (entity); Propertyinfo[] Props = entity. GetType (). GetProperties (); foreach (PropertyInfo prop in props) {if (Prop. GetValue (entity, NULL)! = NULL) {if (Prop. GetValue (entity, NULL). ToString () = = " ") DbContext. Entry (entity). Property (Prop. Name). CurrentValue = null; DbContext. Entry (entity). Property (Prop. Name). IsModified = true; }} return DbContext. SaveChanges (); } public int Delete (TEntity entity) {DbContext. Set<tentity> (). Attach (entity); DbContext. Entry<tentity> (entity). state = entitystate.deleted; Return DbContext. SaveChanges (); } public int Delete (expression<func<tentity, bool>> predicate) {var entitys = Dbcont Ext. Set<tentity> (). Where (predicate). ToList (); Entitys. ForEach (M = dbcontext. Entry<tentity> (M). state = entitystate.deleted); Return DbContext. SaveChanges (); Public TEntity findentity (object keyValue) {return dbcontext. Set<tentity> (). Find (KeyValue); } public TEntity findentity (expression<func<tentity, bool>> predicate) {return Dbcon Text. Set<tentity> (). FirstOrDefault (predicate); } public iqueryable<tentity> IQueryable () {return dbcontext. Set<tentity> (); } public iqueryable<tentity> IQueryable (expression<func<tentity, bool>> predicate) { Return DbContext. Set<tentity> (). Where (predicate); Public list<tentity> findlist (string strSQL) {return dbcontext. Database.sqlquery<tentity> (strSQL). Tolist<tentity> (); } public LIST< Tentity> findlist (String strSQL, dbparameter[] dbparameter) {return dbcontext. Database.sqlquery<tentity> (strSQL, DbParameter). Tolist<tentity> (); } public list<tentity> Findlist (pagination pagination) {bool ISASC = Pagination.sord.ToLow ER () = = "ASC"? True:false; string[] _order = Pagination.sidx.Split (', '); Methodcallexpression resultexp = null; var tempdata = DbContext. Set<tentity> (). AsQueryable (); foreach (string item in _order) {string _orderpart = Item; _orderpart = Regex.Replace (_orderpart, @ "\s+", ""); string[] _orderarry = _orderpart.split ("); String _orderfield = _orderarry[0]; bool sort = ISASC; if (_orderarry.length = = 2) {ISASC = _orderarry[1]. ToUpper () = = "ASC"? True:false; } var parameter = Expression.parameter (typeof (TEntity), "T"); var property = typeof (TEntity). GetProperty (_orderfield); var propertyaccess = expression.makememberaccess (parameter, property); var orderbyexp = Expression.lambda (propertyaccess, parameter); Resultexp = Expression.call (typeof (Queryable), Isasc? "By": "OrderByDescending", new type[] {typeof (TEntity), property. PropertyType}, Tempdata.expression, Expression.quote (orderbyexp)); } TempData = tempdata.provider.createquery<tentity> (RESULTEXP); Pagination.records = Tempdata.count (); TempData = tempdata.skip<tentity> (Pagination.rows * (pagination.page-1)). Take<tentity> (pagination.rows). AsQueryable (); return Tempdata.tolist (); } public list<tentity> findlist (expression<func<tentity, bool>> predicate, Pagination Pagination) {bool Isasc = pagination.Sord. ToLower () = = "ASC"? True:false; string[] _order = Pagination.sidx.Split (', '); Methodcallexpression resultexp = null; var tempdata = DbContext. Set<tentity> (). Where (predicate); foreach (string item in _order) {string _orderpart = Item; _orderpart = Regex.Replace (_orderpart, @ "\s+", ""); string[] _orderarry = _orderpart.split ("); String _orderfield = _orderarry[0]; bool sort = ISASC; if (_orderarry.length = = 2) {ISASC = _orderarry[1]. ToUpper () = = "ASC"? True:false; } var parameter = Expression.parameter (typeof (TEntity), "T"); var property = typeof (TEntity). GetProperty (_orderfield); var propertyaccess = expression.makememberaccess (parameter, property); var orderbyexp = Expression.lambda (propertyaccess, parameter); Resultexp = Expression.call (typeof (Queryable), Isasc? "By": "OrderByDescending", new type[] {typeof (TEntity), property. PropertyType}, Tempdata.expression, Expression.quote (orderbyexp)); } TempData = tempdata.provider.createquery<tentity> (RESULTEXP); Pagination.records = Tempdata.count (); TempData = tempdata.skip<tentity> (Pagination.rows * (pagination.page-1)). Take<tentity> (pagination.rows). AsQueryable (); return Tempdata.tolist (); } }}
Auto-Map Object entities
Frame Interface Display:
Supports multi-skin switching
The next article for you to explain how to achieve dynamic skin Switch Summary:
1: This article does not explain the implementation mechanism in detail.
2: This article does not explain the development method in detail.
But, at least you can: look at the source code, look at the API, see the demo, you can also join the technical Exchange group for sharing.
Of course, follow-up I will add related articles, more detailed and perfect the mechanism and development methods.
If you support the spirit of open source, you can praise the spirit level to encourage additional: there are bugs and loopholes, please privately submit the framework open source address:
1, Source: http://download.csdn.net/detail/nfine_2016/9608074
NET Mvc+ef6+bootstrap