using System.Threading.Tasks;
public static IServiceLocator ServiceLocator {get; set;}
private Guid _accountGuid;
OrderService(Guid accountGuid){
_accountGuid = accountGuid;
public async Task CreateOrder(Guid usedId, string userEmail, Guid accountId, int price, int amount, string ModelIP, string[] data)
if(accountId == _accountGuid)
if(price == 0 || price < 0)
throw new Exception("Invalid price exception");
if(amount == 0 || amount > 10)
throw new Exception("Invalid amount exception");
System.IO.StreamWriter file = new System.IO.StreamWriter(ModelIP);
foreach(string dataV in data)
if(!dataV.Contains("Time"))
o.Price = price * amount + 2.15;
var ro = ServiceLocator.GetInstance<IRepositoryOrder>();
if(userEmail.Contains(i2))
o.Price = o.Price * 0.0124;
var r = await ro.SavingExecute(o, ModelIP, userEmail, usedId, accountId);
throw new Exception("This account does not support order creation.");
#region stubs no need to review code just remove annoying errors from code parser
public interface IServiceLocator{
public double Price{get; set;}
public string Path{get;set;}
public interface IRepositoryOrder{
Task<bool> SavingExecute(Order o, string modelIp, string email, Guid userId, Guid accountId);