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
static void Main(string[] args) | |
{ | |
var pieces = new List<MailPiece>(); | |
for (long index = 0; index < 23458333; index++) | |
{ | |
pieces.Add(new Letter() { DestinationZip = (int)(index % 100000) }); | |
} | |
Console.ReadLine(); | |
} |
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
static void Main(string[] args) | |
{ | |
var pieces = new List<MailPiece>(); | |
for (long index = 0; index < 563000000; index++) | |
{ | |
pieces.Add(new Letter() { DestinationZip = (int)(index % 100000) }); | |
} | |
Console.ReadLine(); | |
} |
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 Postcard : MailPiece | |
{ | |
public override decimal Postage { get; set; } | |
public override decimal Width { get; set; } | |
public override decimal Height { get; set; } | |
public override decimal Thickness { get; set; } | |
public Postcard() | |
{ | |
Postage = 0.33M; |
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 Letter : MailPiece | |
{ | |
public override decimal Postage { get; set; } | |
public override decimal Width { get; set; } | |
public override decimal Height { get; set; } | |
public override decimal Thickness { get; set; } | |
public Letter() | |
{ | |
Postage = 0.46M; |
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 abstract class MailPiece | |
{ | |
public abstract decimal Postage { get; set; } | |
public abstract decimal Width { get; set; } | |
public abstract decimal Height { get; set; } | |
public abstract decimal Thickness { get; set; } | |
public int DestinationZip { 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
static void Main(string[] args) | |
{ | |
var pieces = new List<MailPiece>(); | |
for(long index = 0; index < 563000000; index++) | |
{ | |
pieces.Add(new Letter() { DestinationZip = (index % 100000).ToString() }); | |
} | |
Console.ReadLine(); | |
} |
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 Letter : MailPiece | |
{ | |
public override decimal Postage { get { return 0.46M; } } | |
public override decimal Width { get { return 11.5M; } } | |
public override decimal Height { get { return 6.125M; } } | |
public override decimal Thickness { get { return 0.25M; } } | |
} |
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 Postcard : MailPiece | |
{ | |
public override decimal Postage { get { return 0.33M; } } | |
public override decimal Width { get { return 6; } } | |
public override decimal Height { get { return 4.25M; } } | |
public override decimal Thickness { get { return 0.016M; } } | |
} |
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 abstract class MailPiece | |
{ | |
public abstract decimal Postage { get; } | |
public abstract decimal Width { get; } | |
public abstract decimal Height { get; } | |
public abstract decimal Thickness { get; } |
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 ValuesController : ApiController | |
{ | |
// GET api/values | |
public IEnumerable<string> Get() | |
{ | |
return new string[] { "value1", "value2" }; | |
} | |
// GET api/values/5 | |
public string Get(int id) |