using (var dataContext = new SampleDbContext()) { var categoryID = 1; var categoryName = "Product"; var result = dataContext.Database.ExecuteSqlCommand($"UPDATE dbo.Category SET CategoryName={categoryName} WHERE CategoryID={categoryID}"); }
×ܽ᱾½Ú½éÉÜÁËEntity Framework CoreÖÐÖ´ÐÐSQLÓï¾äºÍ´æ´¢¹ý³ÌµÄ¼¸ÖÖ·½·¨£¬ Ï£Íû¶ÔÄúÓаïÖú£¬Ð»Ð»£¡
×÷ÕߣºSweet Tang
±¾ÎĵØÖ·£º
»¶ÓתÔØ£¬ÇëÔÚÃ÷ÏÔλÖøø³ö³ö´¦¼°Á´½Ó¡£
¡¡