“linq bergabung” Kode Jawaban

linq bergabung

var id = 1;
var query =
   from post in database.Posts
   join meta in database.Post_Metas on post.ID equals meta.Post_ID
   where post.ID == id
   select new { Post = post, Meta = meta };
Tense Tuatara

Cara Menulis Kueri Bergabung di Linq C#

 var locationInfo = entities.TagTemperatures    // your starting point - table in the "from" statement
            .Join(entities.ReverseGeoFenceAddresses, // the source table of the inner join
               tt => tt.TagTemperatureId,        // Select the primary key (the first part of the "on" clause in an sql "join" statement)
               rg => rg.TagTemperatureId,   // Select the foreign key (the second part of the "on" clause)
               (tt, rg) => new { TT = tt, RG = rg }) // selection
            .Where(TTandRG => TTandRG.TT.TagId == tag.TagId && TTandRG.TT.SampleTime > StartDate && TTandRG.TT.SampleTime < EndDate)
            .Select(X => new { X.TT.Latitude, X.TT.Longitude, X.TT.SampleTime, X.TT.TemperatureCelsius, X.TT.isAlert, X.TT.isYAlert, X.RG.FullAddress }).ToList();    // where statement
Ugliest Unicorn

Jawaban yang mirip dengan “linq bergabung”

Pertanyaan yang mirip dengan “linq bergabung”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya