This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void Load() | |
| { | |
| if (!View.IsPostBack) | |
| { | |
| var batcher = new ServiceCallBatcher(service); | |
| batcher.Add(new GetProductCategoriesRequest()); | |
| batcher.Add(new GetSuppliersRequest()); | |
| View.ProductCategories = batcher.Get<GetProductCategoriesResponse>().ProductCategories; | |
| View.Suppliers = batcher.Get<GetSuppliersResponse>().Suppliers; | |
| View.DataBind(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public abstract class Command | |
| { | |
| private readonly List<string> errorMessages = new List<string>(); | |
| public void Execute() | |
| { | |
| try | |
| { | |
| CheckAuthorization(); | |
| CheckErrorMessages(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class SelectCommandCombiner | |
| { | |
| private readonly List<SqlCommand> commands = new List<SqlCommand>(); | |
| public SelectCommandCombiner() : this(new SqlCommand[0]) { } | |
| public SelectCommandCombiner(IEnumerable<SqlCommand> commandsToCombine) | |
| { | |
| commands = new List<SqlCommand>(); | |
| if (commandsToCombine != null) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [SocketException (0x2746): An existing connection was forcibly closed by the remote host] | |
| System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) +73 | |
| System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing) +110 | |
| [CommunicationException: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:29:59.8590000'.] | |
| System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing) +183 | |
| System.ServiceModel.Channels.SocketConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout) +54 | |
| System.ServiceModel.Channels.DelegatingConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout) +32 | |
| System.ServiceModel.Channels.ConnectionStream. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class MyDisposableClass : IDisposable | |
| { | |
| private bool disposed = false; | |
| public void Dispose() | |
| { | |
| Dispose(true); | |
| // prevent this object from being placed in the finalization queue if some | |
| // derived class provides a finalizer | |
| GC.SuppressFinalize(this); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Publisher | |
| { | |
| public event EventHandler MyEvent; | |
| public void FireEvent() | |
| { | |
| if (MyEvent != null) | |
| { | |
| MyEvent(this, EventArgs.Empty); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public IEnumerable<Product> TransformTableToListOfProducts(DataTable table) | |
| { | |
| var products = new List<Product>(); | |
| foreach (DataRow row in table.Rows) | |
| { | |
| products.Add(TransformRowToProduct(row)); | |
| } | |
| return products; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <bindings> | |
| <netTcpBinding> | |
| <binding name="MyTcpBinding" maxReceivedMessageSize="2147483647" receiveTimeout="00:30" sendTimeout="00:30"> | |
| <readerQuotas maxStringContentLength="8192" maxArrayLength="20971520" /> | |
| </binding> | |
| </netTcpBinding> | |
| </bindings> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <class name="CrudTest" table="CrudTest"> | |
| <id name="Id" column="Id" type="guid" > | |
| <generator class="assigned" /> | |
| </id> | |
| <property name="Description" column="Description" type="string" length="200" not-null="true" /> | |
| </class> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var testObjects = CreateTestObjects(500000); | |
| var stopwatch = new Stopwatch(); | |
| stopwatch.Start(); | |
| using (ITransaction transaction = Session.BeginTransaction()) | |
| { | |
| foreach (var testObject in testObjects) | |
| { | |
| Session.Save(testObject); |