private void Fetch(Sprint sprint, SprintData sprintData) { DataMapper.Map(sprint, sprintData); sprintData.Project = new ProjectData(); DataMapper.Map(sprint.Project, sprintData.Project); sprintData.CreatedByUser = new UserData(); DataMapper.Map(sprint.CreatedByUser, sprintData.CreatedByUser); sprintData.ModifiedByUser = new UserData(); DataMapper.Map(sprint.ModifiedByUser, sprintData.ModifiedByUser); }
public SprintData Update(SprintData data) { using (var ctx = Csla.Data.ObjectContextManager<ApplicationEntities> .GetManager(Database.ApplicationConnection, false)) { var sprint = new Sprint { SprintId = data.SprintId }; ctx.ObjectContext.Sprints.Attach(sprint); DataMapper.Map(data, sprint); ctx.ObjectContext.SaveChanges(); return data; } }
public SprintData Insert(SprintData data) { using (var ctx = Csla.Data.ObjectContextManager<ApplicationEntities> .GetManager(Database.ApplicationConnection, false)) { var sprint = new Sprint(); DataMapper.Map(data, sprint); ctx.ObjectContext.AddToSprints(sprint); ctx.ObjectContext.SaveChanges(); data.SprintId = sprint.SprintId; return data; } }
/// <summary> /// Deprecated Method for adding a new object to the Sprints EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToSprints(Sprint sprint) { base.AddObject("Sprints", sprint); }
/// <summary> /// Create a new Sprint object. /// </summary> /// <param name="sprintId">Initial value of the SprintId property.</param> /// <param name="completedDate">Initial value of the CompletedDate property.</param> /// <param name="isActive">Initial value of the IsActive property.</param> /// <param name="isArchived">Initial value of the IsArchived property.</param> /// <param name="isCompleted">Initial value of the IsCompleted property.</param> /// <param name="duration">Initial value of the Duration property.</param> /// <param name="estimatedCompletedDate">Initial value of the EstimatedCompletedDate property.</param> /// <param name="estimatedDuration">Initial value of the EstimatedDuration property.</param> /// <param name="name">Initial value of the Name property.</param> /// <param name="projectId">Initial value of the ProjectId property.</param> /// <param name="createdBy">Initial value of the CreatedBy property.</param> /// <param name="createdDate">Initial value of the CreatedDate property.</param> /// <param name="modifiedBy">Initial value of the ModifiedBy property.</param> /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param> /// <param name="description">Initial value of the Description property.</param> public static Sprint CreateSprint(global::System.Int32 sprintId, global::System.DateTime completedDate, global::System.Boolean isActive, global::System.Boolean isArchived, global::System.Boolean isCompleted, global::System.Decimal duration, global::System.DateTime estimatedCompletedDate, global::System.Decimal estimatedDuration, global::System.String name, global::System.Int32 projectId, global::System.Int32 createdBy, global::System.DateTime createdDate, global::System.Int32 modifiedBy, global::System.DateTime modifiedDate, global::System.String description) { Sprint sprint = new Sprint(); sprint.SprintId = sprintId; sprint.CompletedDate = completedDate; sprint.IsActive = isActive; sprint.IsArchived = isArchived; sprint.IsCompleted = isCompleted; sprint.Duration = duration; sprint.EstimatedCompletedDate = estimatedCompletedDate; sprint.EstimatedDuration = estimatedDuration; sprint.Name = name; sprint.ProjectId = projectId; sprint.CreatedBy = createdBy; sprint.CreatedDate = createdDate; sprint.ModifiedBy = modifiedBy; sprint.ModifiedDate = modifiedDate; sprint.Description = description; return sprint; }
internal static void Map(SprintData source, Sprint destination) { destination.SprintId = source.SprintId; destination.CompletedDate = source.CompletedDate; destination.Description = source.Description; destination.IsActive = source.IsActive; destination.IsArchived = source.IsArchived; destination.IsCompleted = source.IsCompleted; destination.Duration = source.Duration; destination.EstimatedCompletedDate = source.EstimatedCompletedDate; destination.EstimatedDuration = source.EstimatedDuration; destination.Name = source.Name; destination.ProjectId = source.ProjectId; destination.CreatedBy = source.CreatedBy; destination.CreatedDate = source.CreatedDate; destination.ModifiedBy = source.ModifiedBy; destination.ModifiedDate = source.ModifiedDate; }