private void detach_DatabaseUserMessage(DatabaseUserMessage entity) { this.SendPropertyChanging(); entity.DatabaseUser = null; }
//添加用户聊天信息 public void AddUserMessage(string userName, Message msg) { DatabaseUser targetUser = (from u in dataContext.DatabaseUser where u.UserName == userName select u).Single(); DatabaseUserMessage newUserMessage = new DatabaseUserMessage() { Time = msg.SendTime, Sender = msg.Sender, Receiver = msg.Receiver, Content = msg.Content, Type = msg.Type.ToString() }; targetUser.DatabaseUserMessage.Add(newUserMessage); dataContext.SubmitChanges(); }
partial void UpdateDatabaseUserMessage(DatabaseUserMessage instance);
partial void DeleteDatabaseUserMessage(DatabaseUserMessage instance);
partial void InsertDatabaseUserMessage(DatabaseUserMessage instance);