ããŒã¹ã®ç°¡åãªèª¬æ
åœåãããEloqueraããŒã¿ããŒã¹ã¯.Net Frameworkã«åºã¥ããŠãªããžã§ã¯ããä¿åããããã«äœæãããŸãããããã«ããããªããžã§ã¯ãããŒã¿ããŒã¹ãšãªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ã®äž¡æ¹ã®é·æãåæã«åãå ¥ããããšãã§ããå€ãã®éããå æã§ããŸããã çè«çã«ã¯ãEloqueraã¯.Net Frameworkãã¡ããªãŒã®ä»»æã®èšèªã§åäœããŸãããå®éã«ã¯ãåäœã¯CïŒã§ã®ã¿ãã¹ããããŠããŸãã éçºè ã®äž»ãªçŠç¹ã¯ãšã³ã¿ãŒãã©ã€ãºã»ã°ã¡ã³ãïŒ100 GB以äžïŒã§ãããçµã¿èŸŒã¿ãœãªã¥ãŒã·ã§ã³ã§ã¯ãããŸããããçµã¿èŸŒã¿ãœãªã¥ãŒã·ã§ã³ã泚ç®ãéããŠããŸããã
Eloqueraã®ç¹åŸŽçãªæ©èœã¯éåžžã«å°è±¡çã§ãããåžžã«æŽæ°ãããŠããŸããããã«éåžžã«çããªã¹ãã瀺ããŸãã
- ç¹å¥ãªã€ã³ã¿ãŒãã§ã€ã¹ãã¢ããã¿ãŒãå¿ èŠãšããã«ãCïŒãªããžã§ã¯ãïŒ.Netãã©ãããã©ãŒã äžã®ä»»æã®èšèªã®ãªããžã§ã¯ãïŒãä¿åããŸãã
- ä»»æã®ãã£ãŒã«ã\ããããã£ãæã€åçãªããžã§ã¯ããä¿åããä»»æã®ã¿ã€ãã®ãªããžã§ã¯ãã«ãããã§ããŸãã
- ã¯ãšãªèšèªã¯ã§ããã ãSQLã«è¿ãããªã¬ãŒã·ã§ãã«SQLããŒã¿ããŒã¹ãååšããå¿ èŠã¯ãããŸããã ããã«ãLINQãµããŒãã
- ãªããžã§ã¯ããæ ŒçŽããã圢åŒïŒåæåãå«ãïŒã§ãªããžã§ã¯ããè¿ããŸã
- ãªã¹ãããã³é åã®åœ¢åŒã®ãã©ã¡ãŒã¿ãŒã®ãµããŒã
- ã¯ãšãªã®æ£èŠè¡šçŸã
- ãã³ãã¬ãŒããªããžã§ã¯ãã®ãµããŒãã
- èªã¿åãå°çšãã£ãŒã«ããšããããã£ã埩å ããŸãã
- ãªããžã§ã¯ãã®éšåçãªè¿åŽããµããŒããããŠããŸãã ããšãã°ãForumTopicã¯ã©ã¹ãå¿ èŠãªå ŽåãForumMessagesãžã®ãã¹ãŠã®ãªã³ã¯ããã«ã¢ããããããšã¯ã§ããŸããã
- ãªã¯ãšã¹ãã§è¿ããªããžã§ã¯ãã®æ·±ããæå®ã§ããŸãã
- ã¹ãã¢ãããã·ãŒãžã£ã
èšçœ®
ç»é²åŸãå ¬åŒãŠã§ããµã€ãwww.eloquera.comããåºæ¬ãã£ã¹ããªãã¥ãŒã·ã§ã³ãå ¥æã§ããŸãã ãã¹ã¯ãããã€ã³ã¹ããŒã«çšããã³ãµãŒãã¹ãšããŠã®ã€ã³ã¹ããŒã«çšïŒx86ãŸãã¯x64ïŒã¢ãŒã«ã€ãã®éžæè¢ã衚瀺ãããŸãã EloqueraããµãŒãã¹ãšããŠã€ã³ã¹ããŒã«ããå Žåãèœãšãç©Žã¯ãããŸããã
å€å°ãªããšãææ°ã®ãã·ã³ãžã®ã€ã³ã¹ããŒã«ã«ã¯ã5åããããããŸããã ãã®åŸãããªãã®åŠåã¯æ¬¡ã®ããã«ãªããŸãïŒ
- Eloquera Config Studio;
- Eloquera DB Studio;
- ãµãŒãã¹èªäœãããŒã¹ã®æäœãæ åœããŸãã
ãã¹ã¯ãããããŒãžã§ã³ã¯ãx-copyããŒã¹ã§ã€ã³ã¹ããŒã«ãããŸãã ãã¡ã€ã«ãç®çã®ãã£ã¬ã¯ããªã«ã³ããŒããã ãã§ãã åäœãããã«ã¯ãã€ã³ã¹ããŒã«æžã¿ã®.Net 4 Full Frameworkãå¿ èŠã§ãã
ãã®ã¢ãããŒãã§ã¯ãNuGetããã±ãŒãžã¯éåžžã«æåŸ ãããŠããããã«èŠããŸãããçŸæç¹ã§ã¯ãŸã å©çšã§ããŸããã ãã ããéçºè ã¯ãã®å¯èœæ§ãèªèããŠãããããŒã¿ããŒã¹ã®ã¹ã¿ã³ãã¢ãã³ããŒãžã§ã³ã®å Žåãã«ãŒãã«ã¯å®è¡å¯èœãã¡ã€ã«ã§ã¯ãªãã©ã€ãã©ãªã®åœ¢åŒã§çºè¡ããããšããã«ãããã«äœæããããšãè ããŠããŸãã
åºæ¬ã¢ãŒã
EloqueraããŒã¿ããŒã¹ã¯ããã€ãã®ã¢ãŒãã§åäœããŸãïŒ
- è€æ°ã®ã¢ããªã±ãŒã·ã§ã³çšã®å ±éããŒã¿ããŒã¹ãæšæºã¢ãŒãã
- ã¡ã¢ãªå ã¢ãŒãã
- ãã¹ã¯ããã-ã¢ããªã±ãŒã·ã§ã³ã«çµã¿èŸŒãŸããããŒã¹ã®ã¢ãŒãã
ãµãŒããŒã«æ¥ç¶ããŠããŒã¿ããŒã¹ãäœæããããã®ã³ãŒãïŒ
private const string DBName = "ServiceDatabase"; using (var eloquera = new DB("server=localhost:43962;options=none;")) { eloquera.CreateDatabase(DBName); eloquera.OpenDatabase(DBName); eloquera.Close(); }
DBã¯ã©ã¹ã¯ãããŒã¿ããŒã¹ãžã®æ¥ç¶ã«äœ¿çšãããŸãã æ¥ç¶ã³ã³ã¹ãã©ã¯ã¿ãŒã¯ã¯ã©ã¹ã³ã³ã¹ãã©ã¯ã¿ãŒã«æž¡ãããŸã;ãã®äŸã§ã¯ãæ¥ç¶ã¯ãµãŒãã¹ã«è¡ããŸãã
Eloqueraã¯ããµãŒãã¹ãšããŠäœæ¥ãããšããšãªãã©ã€ã³ã§äœæ¥ãããšãïŒãã¹ã¯ãããã¢ãŒãïŒã®äž¡æ¹ã§ãã€ã³ã¡ã¢ãªã¢ãŒãããµããŒãããŸãã ç¡æçã§ã¯ãã¡ã¢ãªããŒã¹ã¯æ倧1 GBã䜿çšã§ããŸãã ãŸããããŒã¿ããŒã¹ã®ãµã€ãºãWindowsããã£ã¹ã¯äžã®ã¹ã¯ãããã¡ã€ã«ã«é 眮ããããšãããããªãµã€ãºã§ããå¯èœæ§ããããããRAMã®ç©ççãªå¯çšæ§ãèŠããŠãã䟡å€ããããŸãã ãåç¥ã®ããã«ãããã¯é床ããŸã£ããè¿œå ããŸããã
RAMã«ããŒã¿ããŒã¹ãäœæããããšããšã³ãžã³ã«ç€ºãããã«ãæ¥ç¶æååã«ã¡ã¢ãªå ã®ç¹å¥ãªãã©ã¡ãŒã¿ãŒãæå®ããå¿ èŠããããŸãã
new DB("server=(local); options=inmemory;"))
ãã®å ŽåãããŒã¿ããŒã¹ã¯RAMã«ã®ã¿ååšããŸããããã¡ã€ã«ã·ã¹ãã ã«ã¯ç©ºã®ãã¡ã€ã«ãäœæãããŸã ã ãã®ãããªããŒã¿ããŒã¹ã§äœæ¥ãåéã§ããããã«ããã«ã¯ããªãã·ã§ã³ã®æ¥ç¶æååã§persistãã©ã¡ãŒã¿ãŒã䜿çšããå¿ èŠããããŸã
ãã¹ã¯ãããã¢ãŒãã§åäœããã«ã¯ãæ¥ç¶æååã¯æ¬¡ã®ããã«ãªããŸãã
new DB("server=(local); options=none;"))
Eloqueraããã¹ã¯ãããã¢ãŒãã§åäœãéå§ããã«ã¯ãEloqueraDBãµãŒãã¹ãåæ¢ããå¿ èŠããããŸããåæ¢ããªããšãã¢ãã¬ã¹ïŒããŒã«ã«ïŒã®ãµãŒãã¹ã«æ¥ç¶ã§ããªããšãããšã©ãŒã衚瀺ãããŸãã
ããŒã¿ããŒã¹ã«ã¯å€ãã®èå³æ·±ããã®ããããŸãããæãèå³æ·±ããã®ã«ã€ããŠèª¬æããŸãã
åå ãã
æäœã®äžè¬çãªæ§æã¯æ¬¡ã®ãšããã§ãã
SELECT Alias1,Alias2 FROM Type1 Alias1 [ LEFT | RIGHT| INNER | FULL ] JOIN Type2 Alias2 ONSomeFunction(Alias1.Field1, Alias2.Field2)
SELECTã§JOINã䜿çšããŠã¯ãšãªãäœæãããšãã«2ã€ä»¥äžã®ç°ãªãã¿ã€ãã䜿çšãããå Žåããã®ãããªæäœã®çµæã¯æ°ãããªããžã§ã¯ãIEnumerable <Dictionary <stringãobject >>ã«ãªããŸãã
JOINãªã¯ãšã¹ãã¯ãä»ã®ã¿ã€ãã®ãªã¯ãšã¹ããšåæ§ã«ãååä»ããã©ã¡ãŒã¿ãŒã䜿çšã§ããŸãã åŒONãå«ããŸãã ãã ããçæãã¹ãå¶éãããã€ããããŸãã
- ãã©ã¡ãŒã¿ã®å€ã¯ãã¯ãšãªãéå§ããåã«æ±ºå®ããå¿ èŠããããŸãã
- ååä»ããã©ã¡ãŒã¿ãŒã䜿çšããŠãSelectã¹ããŒãã¡ã³ãã®ååã眮ãæããããšã¯ã§ããŸããã ã€ãŸã éžæã¿ã€ããåŒã³åºãããšããè©Šã¿ã¯ãã«ãŒã«ã®å€ã«ãªããŸãã
ãããšã¯å¥ã«ãJOINåŒã®æ§ç¯ã«é¢ä¿ããã¯ã©ã¹ã®åå«ã§åé¡ãã©ã®ããã«è§£æ±ºããããã«ã€ããŠèšåãã䟡å€ããããŸãã æšæºçãªåäœã¯ãã¯ãšãªã§ç¶æ¿ãããåã䜿çšããæ©èœã§ãã ããšãã°ãTypeCãTypeAããç¶æ¿ãããå ŽåãåŒã¯æ¬¡ã®ããã«ãªããŸãã
SELECT a, b FROM TypeA a INNER JOIN TypeB b ON b.id = a.id
åŒã®æ¡ä»¶ãæºããå Žåããaããã£ãŒã«ãã«TypeCãªããžã§ã¯ããè¿ãããšãã§ããŸãã ã¯ãšãªçµæã®ã¯ã©ã¹ã®ãã¹ãŠã®åå«ãåé€ããã«ã¯ãONLYãšããåèªã䜿çšããŸãã ã€ãŸã 次ã®ããã«ãªã¯ãšã¹ããæžãæããŸãã
SELECT a, b FROM ONLY TypeA a INNER JOIN TypeB b ON b.id = a.id
ããã§ããã£ãŒã«ããaãã«ã¯ãã¿ã€ãTypeAã®ãªããžã§ã¯ãã®ã¿ãååšããŸãã
å éšçµåã®äœæ¥ã«é¢ããåçã®äŸã 次ã®ãããªããŒã¿æ§é ããããšããŸãã
1ã€ã®å Žæã«ãããã¹ãŠã®åŠæ ¡ãšä»äºãèŠã€ãããšãã課é¡ã«çŽé¢ããŠããŸãã
ã³ãŒãïŒ
var queryResult = (IEnumerable<Dictionary<string,object>>) db.ExecuteQuery("SELECT sch, wp FROM School sch INNER JOIN WorkPlace wp ONch.Location=wp.Location");
衚圢åŒã®çµæã¯ã次ã®ããã«è¡šãããšãã§ããŸãã
ïŒ
| queryResult [ãschã]
| queryResult ["wp"]
|
1
| School1
| wPlace2
|
2
| School2
| wPlace2
|
3
| School3
| wPlace3
|
4
| School3
| wPlace4
|
ãã©ã¡ãŒã¿
ãã©ã¡ãŒã¿ã¯ããŒã¿ããªã¯ãšã¹ãã«è»¢éããããã«ã®ã¿äœ¿çšã§ããããããã©ã¡ãŒã¿ãä»ããŠããŒã¿ãåä¿¡ããããšãæ³åããã®ã¯ç¡æå³ã§ãã
ãã©ã¡ãŒã¿ã®äœ¿çšã¯éåžžã«ç°¡åã§ãã
Parameters param = db.CreateParameters(); param["name"] = "John"
ãªã¯ãšã¹ãã§ãã©ã¡ãŒã¿ã䜿çšããã«ã¯ãããããåãå ¥ãããªãŒããŒããŒãã¡ãœããã䜿çšããå¿ èŠããããŸãã äŸïŒ
var res = db.ExecuteQuery("SELECT BasicUser WHERE Name = @name", param);
ãã©ã¡ãŒã¿å€ã®é åã¯ãããŒã¿ããŒã¹ã«ãã£ãŠåçŽãªé åãšããŠè§£éã§ããŸãã
Parameters param = db.CreateParameters(); param.AddList("emails", new string[]{"john@gmail.com", "david@hotmail.com"}); var res = db.ExecuteQuery("SELECT BasicUser WHERE ALL @emails in Emails", param);
ãã©ã¡ãŒã¿ãŒã¯ãTopãSkipãããã³Ordeââr Byã§äœ¿çšã§ããŸãã ãã©ã¡ãŒã¿ã«ã¯nullãå«ãŸããå ŽåããããŸãã
ã¹ãã¢ãããã·ãŒãžã£
ããŒãžã§ã³4.0以éãEloqueraã¯ã¹ãã¢ãããã·ãŒãžã£ããµããŒãããŠããŸãã
ã¹ãã¢ãããã·ãŒãžã£ã¯ãã¡ã€ã³ããŒã¿ããŒã¹ã®æ¡åŒµã¡ãœãããšèŠãªãããšãã§ããŸãã ãããã¯ãCïŒã䜿çšããŠèšè¿°ãããŠããŸããããã¯ãäœæè ã®ãããã§ããã®åé¡ã«ã€ããŠè§£éãããæ¹èšãçºæããªãã£ãããã§ãã ããã·ãŒãžã£ãèšè¿°ãããšãã«ããã¹ãŠã®.Netæ©èœã䜿çšã§ããããšãããããŸããã
ååãªèšèã§èšãã°ãã¹ãã¢ãããã·ãŒãžã£ãå®éã«ã©ã®ããã«äœæããããã瀺ãæ¹ãè¯ãã§ãããã
æåã®æé ã¯ãç®çã®ããã·ãŒãžã£ã䜿çšããŠã€ã³ã¿ãŒãã§ã€ã¹ã宣èšããããšã§ãã ãã®ã€ã³ã¿ãŒãã§ã€ã¹ã¯ãã¯ã©ã€ã¢ã³ãåŽãšãµãŒããŒåŽã«ãªããã°ãªããŸããã
public interface ICityStatisticSP{ CityCars GetCityCars(string cityName); }
次ã«ããµãŒããŒåŽã§ã®ã¿å¿ èŠãªã¯ã©ã¹ãäœæããŸãã ãã®å Žåãããã·ãŒãžã£ãå®è£ ããã©ã€ãã©ãªãããŒã¿ããŒã¹ãã£ã¬ã¯ããªã®Libãã©ã«ãã«é 眮ããããã¹ãã¢ãããã·ãŒãžã£ãå«ãã©ã€ãã©ãªãžã®ãã¹ãStoredProceduresPathãã©ã¡ãŒã¿ãŒã䜿çšããŠæ§æããå¿ èŠããããŸãã
public class CityStatisticSP: StoredProcedure, ICityStatisticSP { public CityCars GetCityCars(string cityName) { Parameters parms = db.CreateParameters(); parms["city"] = cityName; var cars = db.ExecuteQuery("SELECT Car FROM Car JOIN Seller ON Car.SellerID = Seller.ID WHERE Seller.City = @city", parms) .OfType<Car>() .ToList(); ⊠} }
æ°ããããã·ãŒãžã£ãè¿œå ããå ŽåãããŒã¿ããŒã¹ãµãŒãã¹ãåèµ·åããå¿ èŠã¯ãããŸããã
ããã·ãŒãžã£ãå«ãã©ã€ãã©ãªããµãŒããŒã«ã¹ããŒããåŸã次ã®ã³ãŒãã䜿çšããŠã¯ã©ã€ã¢ã³ãã§ããã·ãŒãžã£ãåŒã³åºãããšãã§ããŸãã
ICityStatisticSP procedures = db.GetStoredProcedureClass<ICityStatisticSP>(); string cityName = "Chicago"; CityCars cars = procedures.GetCityCars(cityName);
ããŒã¿ããŒã¹ã®ãŸãã«ãªããžã§ã¯ãã®æ§è³ªã«åºã¥ããŠããããã³ã°æ§ææé ããã®ä»ã®æé ãæ§æããå¿ èŠã¯ãããŸããã
æ¢åã®ãã©ãŒã ã«ã¹ãã¢ãããã·ãŒãžã£ãååšããããšã§ãããŒã¿ããŒã¹ã¯ãšãªãåã«ä¿åããã³åŒã³åºããããããè€éãªåé¡ã解決ã§ããŸãã ãã¹ãŠã®ã³ãŒããããŒã¹åŽã§å®è¡ãããããšã匷調ãã䟡å€ããããŸã ã ã€ãŸã ããã·ãŒãžã£ã䜿çšãããšããããã¯ãŒã¯ã®è² è·ãå€§å¹ ã«åæžã§ããŸããããã·ãŒãžã£ã䜿çšãããšãããšãã°ãæ°ããèŠçŽ ãäœæããŠããŒã¿ããŒã¹ã«ä¿åãããªã©ããµãŒããŒåŽã§ããŒã¿ãããå¹æçã«ãã£ã«ã¿ãªã³ã°ã§ããŸãã ããŒã¿ããŒã¹ããå€ãã®èŠçŽ ãäœããã®å€ã§è¿œå ããå¿ èŠãããç¶æ³ãæ³åããããšã¯é£ãããªããšæããŸãã å€ãã¢ãããŒãã§ã¯ããã¹ãŠã®èŠçŽ ãã¢ã³ããŒãããæŽæ°ã®ããã®æ¡ä»¶ã«åŸã£ãŠéžæãäœæããæŽæ°ãããããã¯ãŒã¯äžã§æ°ããããŒã¿ãäžæžãããå¿ èŠããããŸããã ã¹ãã¢ãããã·ãŒãžã£ã¯ããã®ãããªåé¡ãããå¹ççã«è§£æ±ºããŸãã
åçãªããžã§ã¯ãïŒåçïŒ
Eloqueraã®éçºè ã«ãããšã圌ãã¯ãªããžã§ã¯ãããŒã¹ã«ããã€ãã®éæ³ãè¿œå ããç¬èªã®æ©èœãšDynamicãšåŒã°ãããªããžã§ã¯ããåŸãŸããã ãã®æ©èœããèãã©ãã§æé·ãããããããŠãããCïŒã§ã€ããªãã®ãŒçã«èª¿æŽããããã®ãæ¢ã«æšæž¬ããŠããŸãã åçãªããžã§ã¯ãã¯ãæ§é åããŒã¿ãšããŠããèªäœã«ä¿åã§ããŸãã CïŒã³ãŒãã§å®çŸ©ãããä»»æã«æ§æãããã¯ã©ã¹ãšæ§é ã ããã«ããããã®ãªããžã§ã¯ããäºãã«èªç±ã«è¡šçŸã§ããŸãã
äž»ãªå©ç¹ã¯ãä¿åããããªããžã§ã¯ãã«ãã£ãŒã«ããè¿œå ããã³åé€ã§ããããšã§ããããŒã¿ã¯éæ³ã®ããã«ãªããžã§ã¯ãã«ã¢ã¿ããããã³åã蟌ãŸããŸãã
åçãªããžã§ã¯ããæäŸããå©ç¹ïŒ
- äœæãšäœ¿çšãç°¡åã§ãã ãã£ãŒã«ããããããã£ã®æ¬ èœãå¿é ããå¿ èŠã¯ãããŸããã ä»»æã®ã¿ã€ãã®ä»»æã®æ°ã®ãã£ãŒã«ã ãã©ã³ã¿ã€ã ã«è¿œå ã§ããŸãã
- ãã£ãŒã«ãã®ã¿ã€ããèªåçã«å€å¥ãããã®æ©èœãšå¶éã«åŸã£ãŠãã£ãŒã«ããæäœããŸãã åçãªããžã§ã¯ãã¯ã€ã³ããã¯ã¹äœæãå®å šã«ãµããŒãããŠããŸãã
- ãããã¯ãäºããåç §ãããäºãã«å«ãŸããããšãã§ããŸãã
- åçãªããžã§ã¯ãã¯éåžžã«é«éã§ãã
- ãããã¯ããã®å Žã§ããã€ãã£ãããªããžã§ã¯ãã«ããŸãã¯ãã®éã«å€æã§ããŸã ã
- ä»äºã®å ŽåãããŒã¿ã¹ããŒã ã¯å¿ èŠãããŸãããããã«ããã掻åã®åéãéåžžã«åºããªããŸãã
- ããã°ãšã³ãžã³ãCMSãwiki
- ãŠãŒã¶ãŒãããã¡ã€ã«ãšç»é²
- ã¬ã³ãŒãå±¥æŽã®ä¿å
- ã©ã³ã¿ã€ã ã§ããŒã¿ããã£ã«ã¿ãªã³ã°ãŸãã¯éçŽããå¿ èŠãããå Žåã
- ç°ãªãã¿ã€ãã®å±æ§ã®æ°ã«ãã£ãŠå€æ°ãæäœããã¢ããªã±ãŒã·ã§ã³ã
æåŸã®2ã€ã®ç¹ã«é¢ããŠããŠãŒã¶ãŒãç¬ç«ããŠããŒã¿åãæ§ç¯ããåãŠãŒã¶ãŒã®ã€ã³ã¿ãŒãã§ã€ã¹ãåçã«æ§æã§ããããã«ããããŸããŸãªããã°ã©ã ãæå³ããããšãæ確ã«ããå¿ èŠããããŸãã ççºçãªè€éãã䌎ãããšãªãããã®ãããªããŒã¿ãå³å¯ãªåœ¢åŒã§ä¿åããåççãªå¯èœæ§ã¯ãããŸããã Dynamicã䜿çšãããšããã®ãããªã¿ã€ããç¡éã®å€æ§æ§ã§èšè¿°ããåäžã®ã¹ã¿ã€ã«ã§ããããæäœã§ããŸãã
å¥ã®äŸã¯web 2.0ã§ããŠãŒã¶ãŒã¯ãã¹ãŠã«ã³ã¡ã³ããè¿œå ããããè³æãé¢é£ä»ãããã§ããŸãã ã¯ã©ã¹ã®å³å¯ãªèšè¿°ã§ããåŸæ¥ã®ãªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ã§ã¯ããã®ãããªã¹ããŒã ãå®è£ ããããšã¯äžå¯èœãŸãã¯éåžžã«å°é£ã§ãã
åçãªããžã§ã¯ãã®æäœã®ç°¡åãªæŠèŠ
åçãªããžã§ã¯ãã®æ§é ã¯ãå«ãŸããããŒã¿ãšãšãã«ãã€ã§ãå€æŽã§ããŸãã 䜿ãããããšãšãã«ãããã¯ããŒã¿ã®é²åã«ååãªæ©äŒãæäŸããŸãã
Dynamic @do = new Dynamic(); @do["Title"] = "Some title"; @do["Price"] = 14.99; @do["DateAdded"] = DateTime.Now; db.Store(@do); Dynamic res = (from Dynamic d in db where d["Price"] == 14.99 select d).First<Dynamic>();
.Net 4ã§å°å ¥ãããã¿ã€ãdynamicã®å€æ°ã䜿çšããŠãåãããšãå¯èœã§ãã
dynamic @do = new Dynamic(); @do.Title = "Some title"; @do.Price = 14.99; @do.DateAdded = DateTime.Now; db.Store(@do); dynamic res = (from Dynamic d in db where d["Price"] == 14.99 select d).First<Dynamic>();
LINQã䜿çšããå Žåã d [â Priceâ]ã䜿çšããŠãåŒããªãŒã®æ§ç¯ãæ瀺çã«ç€ºãå¿ èŠãããããšã«æ³šæããŠãã ããã
åçãªããžã§ã¯ãã䜿çšããå Žåããªããžã§ã¯ãã«å«ãŸãããã¹ãŠã®ãã£ãŒã«ããèŠã€ããããšãã§ããŸãã
Dynamic @do = dynamics[0]; foreach (var field in @do) { Console.WriteLine(String.Format("Field Name {0} Value {1} Type {2}", field.Key, field.Value, field.Type)); }
å¹ åºãå¯èœæ§ã«å ããŠãããã€ãã®å¶éããããŸããç¹ã«ããã£ãŒã«ãåãæå®ãããšãã«äœ¿çšã§ããªãæåã®ãªã¹ãããããŸãã ããã¯ãSQLã¯ãšãªããªããžã§ã¯ãã«æžã蟌ãéã®è¡çªãåé¿ããããã§ãã äºçŽæåã®ãªã¹ãã¯æ¬¡ã®ãšããã§ãã
ããïŒ ] [+-$ïŒ *ïŒïŒ
ãã®ããŒã¹ã«èå³ãæã¡ãå°ãªããšãããŒã å®éšã®ããŒã¹ã«ã€ããŠã¡ã¢ããšã£ãŠãã ããã
èå³æ·±ããã®ãæ¢è£œã®è³æãããå Žåãäžé£ã®èšäºãæŽçã§ããŸãã