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 Order(Object[] params) {} | |
public Order(Order parentOrder) {} | |
} |
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 OrderFactory | |
{ | |
public Order CreateNewOrder(Object[] params) {} | |
public Order CloneOrder(Order parentOrder) {} | |
} |
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
var order = factory.CreateNewOrder(userId, storeId, dispatchDate); |
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
var order = factory.CreateNewOrder(c => | |
{ | |
c.ForThisUser(userId); | |
c.ManagingStockFromThisStore(storeId); | |
c.DispatchingOrderNotBefore(dispatchDate); | |
}); |
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 | |
{ | |
private Order() { } | |
public class Factory | |
{ | |
public Order CreateNewOrder(...) | |
{ | |
var order = new Order(); | |
... |
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 OrderConfiguration | |
{ | |
public Guid UserId { get; private set; } | |
public Guid StoreId { get; private set; } | |
public DateTime DispatchDate { get; private set; } | |
public void ForThisUser(Guid userId) | |
{ | |
UserId = userId; | |
} |
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 | |
{ | |
private Guid _userId; | |
private Guid _storeId; | |
private DateTime _dispatchDate; | |
... | |
public class Factory | |
{ | |
public Order CreateNewOrder(Action<OrderConfiguration> configurator) |
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
var account = CloudStorageAccount.DevelopmentStorageAccount; | |
var client = account.CreateCloudBlobClient(); | |
var container = client.GetContainerReference("images"); | |
container.CreateIfNotExist(); | |
var blob = container.GetBlobReference("first_uploaded_file"); | |
blob.UploadFile("file_path_to_upload"); |
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
// ...setup container | |
var file = container.GetBlockBlobReference("directory/nested_file"); | |
using (var stream = new MemoryStream(File.ReadAllBytes("path_del_file"))) | |
{ | |
stream.Seek(0, SeekOrigin.Begin); | |
file.UploadFromStream(stream); | |
stream.Close(); | |
} |
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
// ...setup container | |
var folder = container.GetDirectoryReference("directory"); | |
var sub = folder.GetBlockBlobReference("nested_file"); | |
using (var stream = new MemoryStream(File.ReadAllBytes("path_del_file"))) | |
{ | |
stream.Seek(0, SeekOrigin.Begin); | |
sub.UploadFromStream(stream); | |
stream.Close(); | |
} |
OlderNewer