private void Fetch(FeedSourceMember feedSourceMember, FeedSourceMemberData feedSourceMemberData) { DataMapper.Map(feedSourceMember, feedSourceMemberData); feedSourceMemberData.CreatedByUser = new UserData(); DataMapper.Map(feedSourceMember.CreatedByUser, feedSourceMemberData.CreatedByUser); }
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; }
protected void Update(FeedSourceMemberData data) { data.FeedSourceMemberId = this.FeedSourceMemberId; data.FeedId = this.FeedId; data.SourceId = this.SourceId; data.SourceTypeId = this.SourceTypeId; data.CreatedBy = this.CreatedBy; data.CreatedDate = this.CreatedDate; }
public FeedSourceMemberData Update(FeedSourceMemberData data) { var feedSource = MockDb.FeedSourceMembers .Where(row => row.SourceId == data.SourceId) .Single(); Csla.Data.DataMapper.Map(data, feedSource); return(data); }
private void Child_Fetch(FeedSourceMemberData data) { this.FeedSourceMemberId = data.FeedSourceMemberId; this.FeedId = data.FeedId; this.SourceId = data.SourceId; this.SourceName = data.Source.Name; this.SourceTypeId = data.SourceTypeId; this.CreatedBy = data.CreatedBy; this.CreatedDate = data.CreatedDate; }
public FeedSourceMemberData Fetch(FeedSourceMemberData data) { data.Source = MockDb.Sources .Where(row => row.SourceId == data.SourceId && row.SourceTypeId == data.SourceTypeId) .Single(); data.CreatedByUser = MockDb.Users .Where(row => row.UserId == data.CreatedBy) .Single(); return data; }
public FeedSourceMemberData Fetch(FeedSourceMemberData data) { data.Source = MockDb.Sources .Where(row => row.SourceId == data.SourceId && row.SourceTypeId == data.SourceTypeId) .Single(); data.CreatedByUser = MockDb.Users .Where(row => row.UserId == data.CreatedBy) .Single(); return(data); }
protected void Fetch(FeedSourceMemberData data) { using (this.BypassPropertyChecks) { this.FeedSourceMemberId = data.FeedSourceMemberId; this.FeedId = data.FeedId; this.SourceId = data.SourceId; this.SourceTypeId = data.SourceTypeId; this.SourceName = data.Source.Name; this.CreatedBy = data.CreatedBy; this.CreatedByName = data.CreatedByUser.Name; this.CreatedDate = data.CreatedDate; } }
public FeedSourceMemberData Insert(FeedSourceMemberData data) { if (MockDb.FeedSourceMembers.Count() == 0) { data.FeedSourceMemberId = 1; } else { data.FeedSourceMemberId = MockDb.FeedSourceMembers.Select(row => row.FeedSourceMemberId).Max() + 1; } MockDb.FeedSourceMembers.Add(data); return data; }
public FeedSourceMemberData Fetch(FeedSourceMemberDataCriteria criteria) { using (var ctx = Csla.Data.ObjectContextManager<ApplicationEntities> .GetManager(Database.ApplicationConnection, false)) { var feedSourceMember = this.Fetch(ctx, criteria) .Single(); var feedSourceMemberData = new FeedSourceMemberData(); this.Fetch(feedSourceMember, feedSourceMemberData); return feedSourceMemberData; } }
public FeedSourceMemberData Fetch(FeedSourceMemberDataCriteria criteria) { using (var ctx = Csla.Data.ObjectContextManager <ApplicationEntities> .GetManager(Database.ApplicationConnection, false)) { var feedSourceMember = this.Fetch(ctx, criteria) .Single(); var feedSourceMemberData = new FeedSourceMemberData(); this.Fetch(feedSourceMember, feedSourceMemberData); return(feedSourceMemberData); } }
public FeedSourceMemberData Insert(FeedSourceMemberData data) { if (MockDb.FeedSourceMembers.Count() == 0) { data.FeedSourceMemberId = 1; } else { data.FeedSourceMemberId = MockDb.FeedSourceMembers.Select(row => row.FeedSourceMemberId).Max() + 1; } MockDb.FeedSourceMembers.Add(data); return(data); }
protected void Child_Update(Feed parent) { using (var dalManager = DataFactoryManager.GetManager()) { var dalFactory = dalManager.GetProvider <IFeedSourceMemberDataFactory>(); var data = new FeedSourceMemberData(); using (this.BypassPropertyChecks) { this.Update(data); data = dalFactory.Update(data); } } }
protected void Child_Update(Feed parent) { using (var dalManager = DataFactoryManager.GetManager()) { var dalFactory = dalManager.GetProvider<IFeedSourceMemberDataFactory>(); var data = new FeedSourceMemberData(); using (this.BypassPropertyChecks) { this.Update(data); data = dalFactory.Update(data); } } }
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); } }
public FeedSourceMemberData[] FetchInfoList(FeedSourceMemberDataCriteria criteria) { using (var ctx = Csla.Data.ObjectContextManager <ApplicationEntities> .GetManager(Database.ApplicationConnection, false)) { var feedSourceMembers = this.Fetch(ctx, criteria) .AsEnumerable(); var feedSourceMemberDataList = new List <FeedSourceMemberData>(); foreach (var feedSourceMember in feedSourceMembers) { var feedSourceMemberData = new FeedSourceMemberData(); this.Fetch(feedSourceMember, feedSourceMemberData); feedSourceMemberDataList.Add(feedSourceMemberData); } return(feedSourceMemberDataList.ToArray()); } }
protected void Child_Insert(Feed parent) { using (var dalManager = DataFactoryManager.GetManager()) { var dalFactory = dalManager.GetProvider<IFeedSourceMemberDataFactory>(); var data = new FeedSourceMemberData(); using (this.BypassPropertyChecks) { this.FeedId = parent.FeedId; this.CreatedBy = ((IBusinessIdentity)Csla.ApplicationContext.User.Identity).UserId; this.CreatedDate = DateTime.Now; this.Insert(data); data = dalFactory.Insert(data); this.FeedSourceMemberId = data.FeedSourceMemberId; } } }
protected void Child_Insert(Feed parent) { using (var dalManager = DataFactoryManager.GetManager()) { var dalFactory = dalManager.GetProvider <IFeedSourceMemberDataFactory>(); var data = new FeedSourceMemberData(); using (this.BypassPropertyChecks) { this.FeedId = parent.FeedId; this.CreatedBy = ((IBusinessIdentity)Csla.ApplicationContext.User.Identity).UserId; this.CreatedDate = DateTime.Now; this.Insert(data); data = dalFactory.Insert(data); this.FeedSourceMemberId = data.FeedSourceMemberId; } } }
public FeedSourceMemberData[] FetchInfoList(FeedSourceMemberDataCriteria criteria) { using (var ctx = Csla.Data.ObjectContextManager<ApplicationEntities> .GetManager(Database.ApplicationConnection, false)) { var feedSourceMembers = this.Fetch(ctx, criteria) .AsEnumerable(); var feedSourceMemberDataList = new List<FeedSourceMemberData>(); foreach (var feedSourceMember in feedSourceMembers) { var feedSourceMemberData = new FeedSourceMemberData(); this.Fetch(feedSourceMember, feedSourceMemberData); feedSourceMemberDataList.Add(feedSourceMemberData); } return feedSourceMemberDataList.ToArray(); } }
private void Fetch(Feed feed, FeedData feedData) { DataMapper.Map(feed, feedData); feedData.Source = new SourceData(); DataMapper.Map(feed.Source, feedData.Source); feedData.CreatedByUser = new UserData(); DataMapper.Map(feed.CreatedByUser, feedData.CreatedByUser); foreach (var feedSourceMember in feed.FeedSourceMembers) { var feedSourceMemberData = new FeedSourceMemberData(); DataMapper.Map(feedSourceMember, feedSourceMemberData); var sourceData = new SourceData(); DataMapper.Map(feedSourceMember.Source, sourceData); feedSourceMemberData.Source = sourceData; feedData.Sources.Add(feedSourceMemberData); } }
private void Child_Fetch(FeedSourceMemberData data) { this.Fetch(data); }
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; } }
public FeedSourceMemberData Update(FeedSourceMemberData data) { var feedSource = MockDb.FeedSourceMembers .Where(row => row.SourceId == data.SourceId) .Single(); Csla.Data.DataMapper.Map(data, feedSource); return data; }
protected void Insert(FeedSourceMemberData data) { this.Update(data); }