why i got same result
Posted: Mon 26 Sep 2011 16:49
use ver3 / mysql 5.5.12 / Win7 x64 / C#
I found I always got same result
my test code is.
but I got this:
I mean i passed 2 different ids:
3D6B6976172C656F3EE3EF45B1442776
and
314198768635805D5F979D0B57B5881C
but the linqConnect generated two same query with first id "3D6B6976172C656F3EE3EF45B1442776" twice, so i got same results, why?
the id is Unique column in the table.
I found I always got same result
my test code is.
Code: Select all
Abc.myDataContext con = new Abc.myDataContext();
con.Log = Console.Out;
var a = con.Monos.SingleOrDefault(x => x.UrlHash == "3D6B6976172C656F3EE3EF45B1442776");
Console.WriteLine(a.Title);
var b = con.Monos.SingleOrDefault(x => x.UrlHash =="314198768635805D5F979D0B57B5881C");
Console.WriteLine(b.Title);
Console.ReadLine();
Code: Select all
SELECT t1.Id, t1.Url, t1.CategoryId, t1.Title, t1.Description, t1.Tosion, t1.Cre
atedAt, t1.ModifiedAt, t1.UrlHash, t1.GoodMember, t1.BadMember, t1.Favicon, t1.D
omain, t1.GoodPoint, t1.BadPoint, t1.UrlType, t1.Tags, t1.Thumbnail, t1.Summary,
t1.ShortenUrl, t1.Views, t1.R18
FROM abida.mono t1
WHERE t1.UrlHash = :p0
-- p0: Input VarChar (Size = 32; DbType = AnsiString) [3D6B6976172C656F3EE3EF45B
1442776]
-- Context: Devart.Data.MySql.Linq.Provider.MySqlDataProvider Model: an Build: 3
.0.4.0
This is title A
SELECT t1.Id, t1.Url, t1.CategoryId, t1.Title, t1.Description, t1.Tosion, t1.Cre
atedAt, t1.ModifiedAt, t1.UrlHash, t1.GoodMember, t1.BadMember, t1.Favicon, t1.D
omain, t1.GoodPoint, t1.BadPoint, t1.UrlType, t1.Tags, t1.Thumbnail, t1.Summary,
t1.ShortenUrl, t1.Views, t1.R18
FROM abida.mono t1
WHERE t1.UrlHash = :p0
-- p0: Input VarChar (Size = 32; DbType = AnsiString) [3D6B6976172C656F3EE3EF45B
1442776]
-- Context: Devart.Data.MySql.Linq.Provider.MySqlDataProvider Model: an Build: 3
.0.4.0
This is title A
3D6B6976172C656F3EE3EF45B1442776
and
314198768635805D5F979D0B57B5881C
but the linqConnect generated two same query with first id "3D6B6976172C656F3EE3EF45B1442776" twice, so i got same results, why?
the id is Unique column in the table.