상속: System.Data.Objects.DataClasses.EntityObject
예제 #1
0
 /// <summary>
 /// Create a new Timeline object.
 /// </summary>
 /// <param name="timelineId">Initial value of the TimelineId property.</param>
 /// <param name="body">Initial value of the Body property.</param>
 /// <param name="isArchived">Initial value of the IsArchived property.</param>
 /// <param name="sourceId">Initial value of the SourceId property.</param>
 /// <param name="sourceTypeId">Initial value of the SourceTypeId 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>
 public static Timeline CreateTimeline(global::System.Int32 timelineId, global::System.String body, global::System.Boolean isArchived, global::System.Int32 sourceId, global::System.Int32 sourceTypeId, global::System.Int32 createdBy, global::System.DateTime createdDate, global::System.Int32 modifiedBy, global::System.DateTime modifiedDate)
 {
     Timeline timeline = new Timeline();
     timeline.TimelineId = timelineId;
     timeline.Body = body;
     timeline.IsArchived = isArchived;
     timeline.SourceId = sourceId;
     timeline.SourceTypeId = sourceTypeId;
     timeline.CreatedBy = createdBy;
     timeline.CreatedDate = createdDate;
     timeline.ModifiedBy = modifiedBy;
     timeline.ModifiedDate = modifiedDate;
     return timeline;
 }
예제 #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Timelines EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToTimelines(Timeline timeline)
 {
     base.AddObject("Timelines", timeline);
 }
예제 #3
0
        public TimelineData Insert(TimelineData data)
        {
            using (var ctx = Csla.Data.ObjectContextManager<ApplicationEntities>
                           .GetManager(Database.ApplicationConnection, false))
            {
                var timeline = new Timeline();

                DataMapper.Map(data, timeline);

                ctx.ObjectContext.AddToTimelines(timeline);

                ctx.ObjectContext.SaveChanges();

                data.TimelineId = timeline.TimelineId;

                return data;
            }
        }
예제 #4
0
        private void Fetch(Timeline timeline, TimelineData timelineData)
        {
            DataMapper.Map(timeline, timelineData);

            timelineData.Source = new SourceData();
            DataMapper.Map(timeline.Source, timelineData.Source);

            timelineData.CreatedByUser = new UserData();
            DataMapper.Map(timeline.CreatedByUser, timelineData.CreatedByUser);

            timelineData.ModifiedByUser = new UserData();
            DataMapper.Map(timeline.ModifiedByUser, timelineData.ModifiedByUser);
        }
예제 #5
0
        public TimelineData Update(TimelineData data)
        {
            using (var ctx = Csla.Data.ObjectContextManager<ApplicationEntities>
                         .GetManager(Database.ApplicationConnection, false))
            {
                var timeline =
                    new Timeline
                    {
                        TimelineId = data.TimelineId
                    };

                ctx.ObjectContext.Timelines.Attach(timeline);

                DataMapper.Map(data, timeline);

                ctx.ObjectContext.SaveChanges();

                return data;
            }
        }
예제 #6
0
 internal static void Map(TimelineData source, Timeline destination)
 {
     destination.TimelineId = source.TimelineId;
     destination.Body = source.Body;
     destination.IsArchived = source.IsArchived;
     destination.SourceId = source.SourceId;
     destination.SourceTypeId = source.SourceTypeId;
     destination.CreatedBy = source.CreatedBy;
     destination.CreatedDate = source.CreatedDate;
     destination.ModifiedBy = source.ModifiedBy;
     destination.ModifiedDate = source.ModifiedDate;
 }