public JsonResult Get()
        {
            this._dbContext = _dbContext.ToRead();//读写分离
            var list = _dbContext.CmNumberInfo.ToList();

            return(new JsonResult(list));
            //return new string[] { "value1", "value2" };
        }
Beispiel #2
0
        public ActionResult <Object> Post([FromServices] ApiDBContent _dbContext, [FromBody] Car car)
        {
            var name       = "Homda";
            var isNeedData = 1;
            var row2       = _dbContext.Database.SqlQuery <Car>(@" exec sp_queryCar 1 ,'Homda'");

            return(row2.ToList());
        }
Beispiel #3
0
 public LoginController(ApiDBContent context, IMemoryCache cache, IUserService userService, IRoleService roleService)
 {
     _userService = userService;
     _roleService = roleService;
     // nLogger2 = logger2;
     this._cache   = cache;
     this._context = context;
 }
 public UserController(ApiDBContent context, IMemoryCache cache, ILogger <UserController> logger2, IUserService userService, IUserLogOnService userLogOnService, IHttpContextAccessor accessor)
 {
     nLogger2               = logger2;
     this._context          = context;
     this._userService      = userService;
     this._userLogOnService = userLogOnService;
     this._cache            = cache;
     _accessor              = accessor;
 }
Beispiel #5
0
        public JsonResult Get()
        {
            this._dbContext = _dbContext.ToRead();//读写分离
            List <CmNumberInfo> cmNumberInfo = new List <CmNumberInfo> ();

            if (RedisHelper.Get("cmnumber") != null)
            {
                cmNumberInfo = System.Text.Json.JsonSerializer.Deserialize <List <CmNumberInfo> >(RedisHelper.Get("cmnumber"));
                //RedisHelper.Del("cmnumber");
            }
            else
            {
                cmNumberInfo = _dbContext.CmNumberInfo.ToList();
                RedisHelper.Set("cmnumber", System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(cmNumberInfo));
            }

            return(new JsonResult(cmNumberInfo));
            //return new string[] { "value1", "value2" };
        }
Beispiel #6
0
 public IEnumerable <CmNumberInfo> GetNumberList()
 {
     _dbContext = _dbContext.ToRead();
     return(_dbContext.CmNumberInfo.Take(2).ToList());
 }
Beispiel #7
0
 public UserService(ApiDBContent dbContext)
 {
     _dbContext = dbContext;
 }
 public RoleRepository(ApiDBContent context) : base(context)
 {
 }
 public OrganizeRepository(ApiDBContent context) : base(context)
 {
 }
 /// <summary>
 /// 测试
 /// </summary>
 /// <param name="dbContext"></param>
 public FirstController(ApiDBContent dbContext, UserService userService)
 {
     _dbContext   = dbContext;
     _userService = userService;
 }
 public UserRepository(ApiDBContent context) : base(context)
 {
 }
Beispiel #12
0
 public ItemsRepository(ApiDBContent context) : base(context)
 {
 }
Beispiel #13
0
 public ValuesController(ApiDBContent dbContext)
 {
     _dbContext = dbContext;
 }
 public ModuleButtonRepository(ApiDBContent context) : base(context)
 {
 }
Beispiel #15
0
 public ModuleRespository(ApiDBContent context) : base(context)
 {
 }
Beispiel #16
0
 public Repository(ApiDBContent context)
 {
     this.Context = context;
     this.DbSet   = context.Set <TEntity>();
 }