CSLA.NET 6.0.0
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
TransactionContextUserList.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="TransactionContextUserList.cs" company="Marimer LLC">
3// Copyright (c) Marimer LLC. All rights reserved.
4// Website: https://cslanet.com
5// </copyright>
6// <summary>no summary</summary>
7//-----------------------------------------------------------------------
8using System;
9using System.Data.SqlClient;
10using Csla.Data;
11
12namespace Csla.Test.Data
13{
15 public class TransactionContextUserList : BusinessBindingListBase<TransactionContextUserList, TransactionContextUser>
16 {
18
19 protected override object AddNewCore()
20 {
22 Add(newUser);
23 return newUser;
24 }
25
27 {
29 }
30
31 protected void DataPortal_Fetch()
32 {
34 {
35 using (var command = new SqlCommand("Select * From Table2", manager.Connection))
36 {
37 using (var reader = new Csla.Data.SafeDataReader(command.ExecuteReader()))
38 {
39 while (reader.Read())
41 }
42 }
43 }
44 }
45
46 [Update]
47 protected void DataPortal_Update()
48 {
50 {
51 foreach (var oneItem in DeletedList)
52 Csla.DataPortal.UpdateChild(oneItem, this);
53
54 foreach (var oneItem in this)
55 Csla.DataPortal.UpdateChild(oneItem, this);
56
57 DeletedList.Clear();
58
59 manager.Commit();
60 }
61 }
62 }
63}
This is the base class from which most business collections or lists will be derived.
MobileList< C > DeletedList
A collection containing all child objects marked for deletion.
Provides an automated way to reuse open database connections within the context of a single data port...
ConnectionManager GetManager(string database)
Gets the ConnectionManager object for the specified database.
This is an IDataReader that 'fixes' any null values before they are returned to our business code.
Provides an automated way to reuse open database connections and associated ADO.NET transactions with...
TransactionManager< C, T > GetManager(string database)
Gets the TransactionManager object for the specified database.
Client side data portal used for making asynchronous data portal calls in .NET.
Definition: DataPortalT.cs:24
void UpdateChild(T child)
Inserts, updates or deletes an existing child business object.
Definition: DataPortalT.cs:734
T Fetch(params object[] criteria)
Called by a factory method in a business class to Fetch a new object, which is loaded with default va...
Definition: DataPortalT.cs:247
static TransactionContextUser NewTransactionContextUser()
static TransactionContextUser GetTransactionContextUser(Csla.Data.SafeDataReader reader)
static TransactionContextUserList GetList()
static string DataPortalTestDatabase
@ Serializable
Prevents updating or inserting until the transaction is complete.
@ Update
Update operation (includes insert, update and delete self).