linq-group

    1热度

    2回答

    我有我的下面的代码几个问题。 var groupedItems = inputFiles.GroupBy(q => q.Name.ToLower().Split('_').ElementAt(2)); string currentNo = ////value retreived from someMethod; if (string.IsNullOrEmpty(curren

    0热度

    1回答

    我有2列clmAge和clmPrice一个表像 Age Price 1 , 100 2 , 100 3 , 150 4 , 150 5 , 100 6 , 100 7 , 100 价格可能会针对不同年龄一样,我需要的是对所有连续的年龄最小和最大年龄的DataTable以相同的价格。我需要我的组数据,以便我的结果是这样的: 1-2 , 100 3-4 , 150 5-7 , 1

    -1热度

    2回答

    我不知道哪里是错误的,为什么它说,不包含ImporteSolicitado,interesesDemora和importeReintegro的确定指标时,他们的C colums和d的最后一个 var importes = (from c in _context.ReintegroSolicitado join d in _context.ReintegroRecibido on c

    0热度

    1回答

    我有三个表(“评级”,“评论”和“用户”)。一个评级可以有多个评论。一条评论属于一个用户。 到目前为止,我有这个工作正常的LINQ语句。 from rating in Ratings join comment in Comments on rating.ID equals comment.RatingID join user in Users on comment.UserID equal

    1热度

    1回答

    有一个集合: List<Tuple<string, string, int>> sales = new List<Tuple<string, string, int>> { Tuple.Create("Store 1", "Product 1", 1000), Tuple.Create("Store 2", "Product 2", 2000), Tupl

    0热度

    1回答

    我在查询2个表,Club和LinkClubUser。我想要从LinkclubUser的最后一个日期检索用户分配的最后一个分会。 我有正确的SQL查询: select top 1 max(A.DataInscricao), A.Nome, A.NomeNaCamisola, A.NumNaCamisola, A.Posicao, A.Situacao from Clu

    2热度

    1回答

    我有一些实例需要返回使用.GroupBy的数据列表。除了日期和整数之外,我还需要返回布尔值,这似乎无法完成。一个例子模型: public class HolidayCheckList { public DateTime startDate { get; set; } public DateTime endDate { get; set; } public int s

    2热度

    1回答

    选择按日期分组多计数我有一个表,看起来大致是这样的: Date | Category | Name 01/02/2014 | A | Foo 01/02/2014 | B | Bar 02/02/2014 | A | Baz 02/02/2014 | A | Bla 我想建立产生像这样的查询: Date | CategoryACount | CategoryBCount

    1热度

    1回答

    我在C#(RoomId,WallTypeId,WallTypeArea)中有我需要由两个组合的原始列表,然后总结第三个。对于每个房间和墙壁我需要一个区域。 (每个房间有多少墙型。)我可以用几个foreach循环来完成它。但是有很多房间,每个墙都被分成很多子表面。 有谁知道更高效的linq和/或IEnumerable方法来做到这一点? 这里是我的阶级和List<RawSurfaceData>: pu

    0热度

    1回答

    在Linq to SQL中,可以按周工作周数进行分组,而不是从每年的几周开始,例如1/1/2016在12周的同一周/ 31/2015这是不同一周的一年(但它是在同一个物理周,如果你愿意)