示例#1
0
文件: TextDAL.cs 项目: ztam/Swtor
 public static Text Load(string textName)
 {
     using (SwtorContext context = new SwtorContext())
     {
         var q = from text in context.Texts where text.Name == Constants.TestTextName select text;
         return q.FirstOrDefault();
     }
 }
示例#2
0
文件: TextDAL.cs 项目: ztam/Swtor
 public static Text Save(int textId, string content)
 {
     using (SwtorContext context = new SwtorContext())
     {
         var text = context.Texts.Where(p => p.TextId == textId).FirstOrDefault();
         context.Entry(text).State = System.Data.EntityState.Modified;
         text.Content = content;
         context.SaveChanges();
         return text;
     }
 }