/// <summary> /// Deprecated Method for adding a new object to the WeightMsg_Post EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToWeightMsg_Post(WeightMsg_Post weightMsg_Post) { base.AddObject("WeightMsg_Post", weightMsg_Post); }
/// <summary> /// Create a new WeightMsg_Post object. /// </summary> /// <param name="post_ID">Initial value of the Post_ID property.</param> /// <param name="title">Initial value of the Title property.</param> /// <param name="post_Content">Initial value of the Post_Content property.</param> /// <param name="dateCreated">Initial value of the DateCreated property.</param> /// <param name="dateModified">Initial value of the DateModified property.</param> /// <param name="userID">Initial value of the UserID property.</param> public static WeightMsg_Post CreateWeightMsg_Post(global::System.Int32 post_ID, global::System.String title, global::System.String post_Content, global::System.DateTime dateCreated, global::System.DateTime dateModified, global::System.Int32 userID) { WeightMsg_Post weightMsg_Post = new WeightMsg_Post(); weightMsg_Post.Post_ID = post_ID; weightMsg_Post.Title = title; weightMsg_Post.Post_Content = post_Content; weightMsg_Post.DateCreated = dateCreated; weightMsg_Post.DateModified = dateModified; weightMsg_Post.UserID = userID; return weightMsg_Post; }
public bool InsertPost(PostModel postModel) { using (Entities entity = new Entities(BaseBISL.ConnectionString)) { WeightMsg_Post post = new WeightMsg_Post(); post.DateCreated = DateTime.Now; post.DateModified = DateTime.Now; post.Post_Content = postModel.PostContent; post.Title = postModel.Title; post.UserID = postModel.UserId; entity.AddToWeightMsg_Post(post); int rows = entity.SaveChanges(); if (rows > 0) return true; else return false; } }