Example #1
0
 ///Realization
 public int Create(ProjectModel project, int userId)
 {
     var newProject = new Projects
                         {
                             Title = project.Title,
                             WelcomeMessage = project.WelcomeMessage,
                             UserId = userId
                         };
     this.db.Projects.AddObject(newProject);
     this.db.SaveChanges();
     return newProject.Id;
 }
Example #2
0
 /// <summary>
 /// Create a new Projects object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="title">Initial value of the Title property.</param>
 /// <param name="welcomeMessage">Initial value of the WelcomeMessage property.</param>
 /// <param name="userId">Initial value of the UserId property.</param>
 public static Projects CreateProjects(global::System.Int32 id, global::System.String title, global::System.String welcomeMessage, global::System.Int32 userId)
 {
     Projects projects = new Projects();
     projects.Id = id;
     projects.Title = title;
     projects.WelcomeMessage = welcomeMessage;
     projects.UserId = userId;
     return projects;
 }
Example #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Projects EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToProjects(Projects projects)
 {
     base.AddObject("Projects", projects);
 }