コード例 #1
0
ファイル: MessageQueue.cs プロジェクト: Aralcom/Parking
        /// <summary>
        /// Saves a new Message
        /// </summary>
        /// <param name="s"></param>
        /// <returns></returns>
        public static MessageQueue Save(MessageQueue s)
        {
            using (EntityContext ctx = new EntityContext())
            {
                s.CreatedAt = DateTime.Now;
                ctx.MessageQueues.AddObject(s);

                ctx.SaveChanges();

                return s;
            }
        }
コード例 #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the MessageQueues EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToMessageQueues(MessageQueue messageQueue)
 {
     base.AddObject("MessageQueues", messageQueue);
 }
コード例 #3
0
 /// <summary>
 /// Create a new MessageQueue object.
 /// </summary>
 /// <param name="messageId">Initial value of the MessageId property.</param>
 /// <param name="to">Initial value of the To property.</param>
 /// <param name="text">Initial value of the Text property.</param>
 /// <param name="createdAt">Initial value of the CreatedAt property.</param>
 public static MessageQueue CreateMessageQueue(global::System.Int32 messageId, global::System.String to, global::System.String text, global::System.DateTime createdAt)
 {
     MessageQueue messageQueue = new MessageQueue();
     messageQueue.MessageId = messageId;
     messageQueue.To = to;
     messageQueue.Text = text;
     messageQueue.CreatedAt = createdAt;
     return messageQueue;
 }