public void SaveMessage(Message message)
 {
     using (EntityConnection connection = new EntityConnection("name=CoreContainer"))
     {
         _core = new CoreContainer(connection);
         _core.Messages.AddObject(message);
         _core.SaveChanges();
     }
 }
示例#2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Messages EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToMessages(Message message)
 {
     base.AddObject("Messages", message);
 }
示例#3
0
 /// <summary>
 /// Create a new Message object.
 /// </summary>
 /// <param name="messageID">Initial value of the MessageID property.</param>
 /// <param name="authorUserId">Initial value of the AuthorUserId property.</param>
 /// <param name="messageScopeId">Initial value of the MessageScopeId property.</param>
 /// <param name="messageBody">Initial value of the MessageBody property.</param>
 /// <param name="dateActive">Initial value of the DateActive property.</param>
 /// <param name="dateExpire">Initial value of the DateExpire property.</param>
 /// <param name="dateCreated">Initial value of the DateCreated property.</param>
 public static Message CreateMessage(global::System.Int32 messageID, global::System.Int32 authorUserId, global::System.Int32 messageScopeId, global::System.String messageBody, global::System.DateTime dateActive, global::System.DateTime dateExpire, global::System.DateTime dateCreated)
 {
     Message message = new Message();
     message.MessageID = messageID;
     message.AuthorUserId = authorUserId;
     message.MessageScopeId = messageScopeId;
     message.MessageBody = messageBody;
     message.DateActive = dateActive;
     message.DateExpire = dateExpire;
     message.DateCreated = dateCreated;
     return message;
 }