This file contains 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 Customer | |
{ | |
public Customer(string name) | |
{ | |
this.Name = name; | |
} | |
string name; | |
public string Name |
This file contains 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 CustomerViewModel | |
{ | |
[Required] | |
public string Name { get; set; } | |
public Customer ToCustomer() | |
{ | |
return new Customer(this.Name); | |
} | |
} |
This file contains 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 ImportRequestModel | |
{ | |
public string SupplierId { get; set; } | |
public string SeedFilePath { get; set; } | |
} | |
public class ImportController : ApiController | |
{ | |
public ImportController(IBus bus) | |
{ |
This file contains 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
[Serializable] | |
public class ImportProducts : NServiceBus.ICommand | |
{ | |
public string TaskId { get; set; } | |
public string SupplierId { get; set; } | |
public string SeedFilePath { get; set; } | |
} | |
[Serializable] | |
public class ImportProduct : NServiceBus.ICommand |
This file contains 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 TaskOverview | |
{ | |
public string TaskId { get; set; } | |
public int Total { get; set; } | |
public int Completed { get; set; } | |
public int Errored { get; set; } | |
public DateTime StartDate { get; set; } | |
public DateTime? EndDate { get; set; } | |
} |
This file contains 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 Invoice | |
{ | |
public string Id { get; private set; } | |
public PurchaseOrder PurchaseOrder { get; set; } | |
public DateTime Date { get; private set; } | |
public ICollection<LineItem> LineItems { get; private set; } | |
} | |
public class PurchaseOrder | |
{ |
This file contains 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 Invoice | |
{ | |
public Invoice(PurchaseOrder purchaseOrder, string number, DateTime date, IEnumerable<LineItem> lineItems) | |
{ | |
this.PurchaseOrder = purchaseOrder; | |
this.Number = number; | |
this.Date = date; | |
this.LineItems = lineItems.ToList(); | |
} | |
public PurchaseOrder PurchaseOrder { get; private set; } |
This file contains 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 Order | |
{ | |
public string Id { get; private set; } | |
public ICollection<LineItem> Items { get; private set; } | |
public LineItem AddItem(string productId, decimal price, int quantity) | |
{ | |
var item = new LineItem(this, productId, price, quantity); | |
this.Items.Add(item); |
This file contains 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 Order | |
{ | |
public string Id { get; private set; } | |
IList<LineItem> items; | |
public ICollection<LineItem> Items | |
{ | |
get { return new ReadOnlyCollection<LineItem>(this.items); } | |
} |
This file contains 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
// the "database" variable is provided by the context | |
from strategy in docs.Strategies | |
let product = database.Load<Product>(strategy.ProductId) | |
select new | |
{ | |
// properties of of pricing strategy and product | |
} |