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

            feedSourceMemberData.CreatedByUser = new UserData();
            DataMapper.Map(feedSourceMember.CreatedByUser, feedSourceMemberData.CreatedByUser);
        }
Exemplo n.º 2
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;
 }
        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);
            }
        }
        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);
            }
        }