asqueryable

    3熱度

    1回答

    也許這是一個簡單的問題,但AsQueryable()有一些性能損失? 一般來說我們正在與RavenDB工作,我們現有的這樣的代碼 protected override IQueryable<T> QueryableIndexRawQuery(string rawQuery, int skip = 0, int take = 128, string indexName = null) {

    4熱度

    1回答

    我總是混淆AsQueryable,AsEnumerable。 我應該什麼時候使用它們?我應該使用AsQueryable來創建一個LINQ語句來根據xml或AsEnumerable的屬性來創建一個過濾器嗎? [Serializable] public class LogHandler : IConfigurationSectionHandler { public object Crea

    4熱度

    1回答

    我正在嘗試使用MongoDB C#驅動程序版本2.2。我正在嘗試使用投影,因爲我不想檢索文檔中的所有元素。 我發現做到這一點的方法之一是使用find操作,像這樣一起使用項目運營商: collection.Find(key => key.Index == 1).Project<MyClass>(Builders<MyClass>.Projection.Include(key => key.Name)

    2熱度

    1回答

    我需要查詢一個WinForms控制(CheckedListBoxControl)具有CheckedListBoxItemCollection我想查詢一定編號即內在CheckedListBoxItem的財產 「價值」 CheckedListBoxItemCollection items = myCheckedListBoxControl.Items; foreach(Department dep

    0熱度

    2回答

    我有一個函數返回一個報表對象,但目前我正在通過foreach看,然後使用asQueryable方法。 我想在一個查詢中做到這一點,而不必使用AsQueryable函數。 var query = from item in context.Dealers where item.ManufacturerId == manufacturerId select item; I

    1熱度

    5回答

    我是新來的反思,所以請原諒我noob問題。如何創建一個帶有兩個參數,一個通用列表和一個字符串的方法,然後查找該列表中任何屬性值與該字符串匹配的所有項目。 因此,例如,我們有3個屬性的對象,我把這個對象傳遞給方法和搜索字符串列表,並返回其中任何屬性可能包含搜索字符串對象的列表。 我可以這樣做: var temp = list.AsQueryable().Where("SomeField == 1")

    2熱度

    1回答

    例如說我有(僞代碼): 在我的數據訪問層到實體框架,這在目前返回,從而保證了我的生意才做了.ToList()public IEnumerable<User> GetUsers(string name)邏輯層不能干擾我的數據訪問層。 但是,在我的業務邏輯層中,我需要稍微不同的變體,例如我需要更少的數據(例如只是userid或進一步過濾它)。 要有一個高效的數據庫層,我希望另一個方法返回數據的一個子集

    12熱度

    3回答

    示例代碼: List<Student> Students = new List<Student>() { new Student(101, "Hugo", "Garcia", new List<int>() { 91, 88, 76, 93 }), new Student(102, "Rick", "Adams", new List<int>() { 70, 73, 66,

    0熱度

    1回答

    嚴重的是,我必須缺少一些簡單的東西。任何幫助將不勝感激。 這是場景: 1)創建一個名爲DoSomething的IQueryable擴展方法,帶有適當的簽名(IQueryable,int x,int y)。 2)使用與IQueryable相同的簽名創建名爲DoSomething的IEnumerable擴展方法,EXCEPT接受/返回IEnumerable而不是IQueryable。 3)在IEnum

    0熱度

    2回答

    我想使用LINQ條件多值數組字符串是split(',') 我列出數據文件夾中的數據文件。 (未在數據庫中) 碼C# public List<sFile> GettingFiles(string path) { //Read File in folder List<sFile> allfile = new List<sFile>(); DirectoryInfo di