Esempio n. 1
0
 public Int32 AddMessage(Message message)
 {
     if (ModelState.IsValid)
     {
         return repository.AddMessage(message);
     }
     return 0;
 }
Esempio n. 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);
 }
Esempio n. 3
0
 /// <summary>
 /// Create a new Message object.
 /// </summary>
 /// <param name="messageID">Initial value of the MessageID property.</param>
 /// <param name="messageType">Initial value of the MessageType property.</param>
 public static Message CreateMessage(global::System.Int32 messageID, global::System.String messageType)
 {
     Message message = new Message();
     message.MessageID = messageID;
     message.MessageType = messageType;
     return message;
 }
 public Int32 AddMessage(Message newMessage)
 {
     entities.Messages.AddObject(newMessage);
     entities.SaveChanges();
     return newMessage.MessageID;
 }