/// <summary> /// Create a new Jokes object. /// </summary> /// <param name="jokeId">Initial value of the JokeId property.</param> /// <param name="userId">Initial value of the UserId property.</param> /// <param name="joke">Initial value of the Joke property.</param> /// <param name="addDate">Initial value of the AddDate property.</param> public static Jokes CreateJokes(global::System.Int32 jokeId, global::System.Int64 userId, global::System.String joke, global::System.DateTime addDate) { Jokes jokes = new Jokes(); jokes.JokeId = jokeId; jokes.UserId = userId; jokes.Joke = joke; jokes.AddDate = addDate; return(jokes); }
public int AddJoke(int pUserId, string pJoke) { int ret = 0; try { if (container == null) { container = new NokatModelContainer(); } Jokes newJoke = new Jokes(){ UserId = pUserId, Joke = pJoke, AddDate=DateTime.Now }; container.AddToJokes(newJoke); container.SaveChanges(); ret = newJoke.JokeId; } catch { ret = 0; } return ret; }
/// <summary> /// Create a new Jokes object. /// </summary> /// <param name="jokeId">Initial value of the JokeId property.</param> /// <param name="userId">Initial value of the UserId property.</param> /// <param name="joke">Initial value of the Joke property.</param> /// <param name="addDate">Initial value of the AddDate property.</param> public static Jokes CreateJokes(global::System.Int32 jokeId, global::System.Int64 userId, global::System.String joke, global::System.DateTime addDate) { Jokes jokes = new Jokes(); jokes.JokeId = jokeId; jokes.UserId = userId; jokes.Joke = joke; jokes.AddDate = addDate; return jokes; }
/// <summary> /// Deprecated Method for adding a new object to the Jokes EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToJokes(Jokes jokes) { base.AddObject("Jokes", jokes); }