相关疑难解决方法(0)

为什么Dictionary优先于Hashtable?

在大多数编程语言中,字典比散列表更受欢迎.这背后的原因是什么?

.net c# vb.net data-structures

1348
推荐指数
17
解决办法
52万
查看次数

如果它存在而不是数据库,我如何缓存对象并从内存中读取?

我有四个课程如下:

public class Section
{
    public int SectionId { get; set; }
    public string Name { get; set; }
    public string Title { get; set; }
    public string MetaTag { get; set; }
    public string MetaDescription { get; set; }
    public string UrlSafe { get; set; }
    public string Header { get; set; }
    public string ImageName { get; set; }
}       

public interface ISectionRepository
{
    List<Section> GetAllSections();
}

public class SectionRepository : ISectionRepository
{
    Context context = new Context(); …
Run Code Online (Sandbox Code Playgroud)

c# caching interface

10
推荐指数
1
解决办法
3万
查看次数

如何将数据库数据缓存到内存中以供MVC应用程序使用?

我有一个有点复杂的权限系统,总共使用六个数据库表,为了加快它,我想将这些表缓存在内存中,而不是每次页面加载时都要访问数据库.

但是,我需要在添加新用户或更改权限时更新此缓存.我不确定如何在内存缓存中使用它,以及如何安全地更新它而不会在更新的同时访问它而不会引起问题

有没有人有一个如何做这样的事情的例子,或者能指出我正确的研究方向?

c# caching asp.net-mvc-4

5
推荐指数
1
解决办法
7185
查看次数

标签 统计

c# ×3

caching ×2

.net ×1

asp.net-mvc-4 ×1

data-structures ×1

interface ×1

vb.net ×1