private static void StoreLocalizedMessage(string key, string v) { string[] keyHash = key.Split(' '); using (DataClassesDataContext db = new DataClassesDataContext()) { Message m = db.Messages.FirstOrDefault(a => a.LookupKey == keyHash[1] && a.Culture == keyHash[0]); if (m == null) { m = new Message { Culture = keyHash[0], LookupKey = keyHash[1], LookupMessage = v, LocalizedMessage = v, // default to standard lookup message CreatedAt = DateTime.UtcNow }; db.Messages.InsertOnSubmit(m); db.SubmitChanges(); } } }
partial void UpdateMessage(Message instance);
partial void DeleteMessage(Message instance);
partial void InsertMessage(Message instance);