小编Nuc*_*ucS的帖子

将EntityFramework.Extended添加到项目中

我已经使用NuGet 添加EntityFramework.Extended(链接)到我的项目.现在我面临一个问题; 我如何使用它的Update功能dbContext

c# entity-framework

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

对 IEnumerable<T> 结果进行分区

我使用的方法处理时间较长,需要返回许多结果,但正确的结果可能是返回的任何结果,比如说在 300,000 个结果之后,但其余 700,000 个结果是否正确将在下面检查主要代码:

//a that suppose to return a value at need.
//Main func might need few returns and not all so 
static IEnumerable<int> foo() {
    //long recusive process, might contain over 1 million results if being asked to yield all.
    yield return ret;
}

static void Main(string[] args) {
    var a = foo();
    while (true) {
        var p = a.Take(300); //takes first 300 every loop in the while-loop
        foreach (var c in p) {
            //does something with …
Run Code Online (Sandbox Code Playgroud)

c# loops

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

关于HashMap.get(key)函数

如果我从HashMap中提取一个对象,然后修改它.它会在HashMap内修改吗?或者,我需要在修改后再将其设置回HashMap吗?

例如:

HashMap<Integer,TwoPoints> loc = new HashMap<Integer,TwoPoints>();
...
...
TwoPoints tp = loc.get(Id); //pulls out the object
tp.setPoint(group, new Point(x,y); //a method to set something inside the object I pulled.
Run Code Online (Sandbox Code Playgroud)

java hashmap

2
推荐指数
1
解决办法
310
查看次数

标签 统计

c# ×2

entity-framework ×1

hashmap ×1

java ×1

loops ×1