Inheritance: System.Data.Objects.DataClasses.EntityObject
        public FeedSourceMemberData Insert(FeedSourceMemberData data)
        {
            using (var ctx = Csla.Data.ObjectContextManager<ApplicationEntities>
                           .GetManager(Database.ApplicationConnection, false))
            {
                var feedSourceMember = new FeedSourceMember();

                DataMapper.Map(data, feedSourceMember);

                ctx.ObjectContext.AddToFeedSourceMembers(feedSourceMember);

                ctx.ObjectContext.SaveChanges();

                data.FeedSourceMemberId = feedSourceMember.FeedSourceMemberId;

                return data;
            }
        }
        private void Fetch(FeedSourceMember feedSourceMember, FeedSourceMemberData feedSourceMemberData)
        {
            DataMapper.Map(feedSourceMember, feedSourceMemberData);

            feedSourceMemberData.CreatedByUser = new UserData();
            DataMapper.Map(feedSourceMember.CreatedByUser, feedSourceMemberData.CreatedByUser);
        }
        public FeedSourceMemberData Update(FeedSourceMemberData data)
        {
            using (var ctx = Csla.Data.ObjectContextManager<ApplicationEntities>
                         .GetManager(Database.ApplicationConnection, false))
            {
                var feedSourceMember =
                    new FeedSourceMember
                    {
                        FeedSourceMemberId = data.FeedSourceMemberId
                    };

                ctx.ObjectContext.FeedSourceMembers.Attach(feedSourceMember);

                DataMapper.Map(data, feedSourceMember);

                ctx.ObjectContext.SaveChanges();

                return data;
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Deprecated Method for adding a new object to the FeedSourceMembers EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToFeedSourceMembers(FeedSourceMember feedSourceMember)
 {
     base.AddObject("FeedSourceMembers", feedSourceMember);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Create a new FeedSourceMember object.
 /// </summary>
 /// <param name="feedSourceMemberId">Initial value of the FeedSourceMemberId property.</param>
 /// <param name="feedId">Initial value of the FeedId 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>
 public static FeedSourceMember CreateFeedSourceMember(global::System.Int32 feedSourceMemberId, global::System.Int32 feedId, global::System.Int32 sourceId, global::System.Int32 sourceTypeId, global::System.Int32 createdBy, global::System.DateTime createdDate)
 {
     FeedSourceMember feedSourceMember = new FeedSourceMember();
     feedSourceMember.FeedSourceMemberId = feedSourceMemberId;
     feedSourceMember.FeedId = feedId;
     feedSourceMember.SourceId = sourceId;
     feedSourceMember.SourceTypeId = sourceTypeId;
     feedSourceMember.CreatedBy = createdBy;
     feedSourceMember.CreatedDate = createdDate;
     return feedSourceMember;
 }
Ejemplo n.º 6
0
 internal static void Map(FeedSourceMember source, FeedSourceMemberData destination)
 {
     destination.FeedSourceMemberId = source.FeedSourceMemberId;
     destination.FeedId = source.FeedId;
     destination.SourceId = source.SourceId;
     destination.SourceTypeId = source.SourceTypeId;
     destination.CreatedBy = source.CreatedBy;
     destination.CreatedDate = source.CreatedDate;
 }