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
[PersistenceConversational(MethodsIncludeMode = MethodsIncludeMode.Explicit)] | |
public class ProductEditPresenter | |
: IInitializablePresenter | |
{ | |
private readonly IDao<Product> daoProduct; | |
private readonly IDao<Category> daoCategory; | |
private readonly IProductEditView productEditView; | |
public ProductEditPresenter( | |
IDaoFactory daoFactory, |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; | |
using System.Text; | |
using PostSharp.Aspects; | |
using PostSharp.Aspects.Advices; | |
using PostSharp.CodeModel; | |
using PostSharp.Extensibility; |
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
[TestFixture] | |
[PersistenceConversational] | |
public class ArticuloDataFixture | |
{ | |
[Inject] | |
private IDao<Articulo> daoArticulo; | |
private Articulo articulo; | |
[TestFixtureSetUp] | |
[PersistenceConversation(ConversationEndMode = EndMode.CommitAndContinue)] |
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 IFoo MyMethod(IBar bar, IBaz baz) | |
{ | |
//My sync code | |
} | |
public IFoo MyMethodAsync(IBar bar, IBaz baz) | |
{ | |
Func<IFoo, IBar, IBaz> func = MyMethod; | |
return func.ToAsync()(bar, baz); | |
} |
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
[Test] | |
public void carga_puntos_de_venta_al_inicializar() | |
{ | |
var puntoVenta = new PuntoVenta(); | |
var view = new Mock<IFacturaPedidoEditarView>(); | |
view.SetupAllProperties(); | |
var cuentaCorriente = new FacturaPedidoEditarPresenter( | |
view.Object, | |
new DaoFactoryStub() |
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
[Test] | |
public void carga_puntos_de_venta_al_inicializar() | |
{ | |
var puntoVenta = new PuntoVenta(); | |
var view = new Mock<IFacturaPedidoEditarView>(); | |
view.SetupAllProperties(); | |
var presenter = new FacturaPedidoEditarPresenter( | |
view.Object, | |
new DaoFactoryStub() |
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
//Esto en el presenter | |
public interface ICajaEditarView | |
: IView | |
{ | |
Caja Caja { get; set; } | |
void SetCuentasContables (IEnumerable<CuentaContable> cuentas) | |
void PuntosVenta (IEnumerable<PuntoVenta> puntosDeVenta) | |
event EventHandler AceptarClicked; |
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
using System; | |
using System.Linq; | |
using System.Collections.Generic; | |
using System.Collections.ObjectModel; | |
using Northwind.Domain; | |
namespace Northwind.Domain.Entities | |
{ | |
[Serializable] | |
public partial class CustomerCustomerDemo : EntityBase<CustomerCustomerDemoCompositeID> |
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
[Test] | |
public void Something() | |
{ | |
var a = new Thread(GetOrAdd); | |
var b = new Thread(GetOrAdd); | |
a.Start();b.Start(); | |
} | |
public void GetOrAdd() | |
{ |
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 Foo | |
{ | |
private readonly StreamWriter streamWriter; | |
private readonly string fileName; | |
private readonly string directory; | |
/// <summary> | |
/// my heavy constructor | |
/// </summary> | |
/// <param name="streamWriter"></param> |