public async Task <bool> Run(DeveloperUniqueId id) { using var connection = new SQLiteConnection (_geekLemonContext.ConnectionString); var q = @"UPDATE Developers SET Status = @Status WHERE UniqueId = @UniqueId;"; try { var result = await connection.ExecuteAsync(q, new { @UniqueId = id.Value.ToString(), @Status = (int)DeveloperStatus.Accepted }); } catch (Exception ex) { return(false); } return(true); }
public async Task <Developer> Run(DeveloperUniqueId id) { using var connection = new SQLiteConnection (_geekLemonContext.ConnectionString); var q = @$ "SELECT Id,UniqueId,Name,Status FROM Developers WHERE UniqueId = @UniqueId"; try { var r = await connection. QueryFirstOrDefaultAsync <DevloperTemp> (q, new { @UniqueId = id.ValueInString(), }); var rmaped = _mapper.Map <Developer>(r); return(rmaped); } catch (Exception ex) { return(null); } }
//public DeveloperStatus Status { get; set; } public DevloperSubmitedEvent(DeveloperUniqueId uniqueId, string name) { UniqueId = uniqueId; Name = name; Key = uniqueId.GetAggregateKey(); }
public DeveloperRejectedEvent(DeveloperUniqueId uniqueId, string name, DeveloperStatus status, int version) { UniqueId = uniqueId; Status = status; Name = name; Version = version; Key = uniqueId.GetAggregateKey(); }
public EsSubmitDeveloperCommand() { Version = 0; UniqueId = new DeveloperUniqueId(); Status = DeveloperStatus.New; }
public Task<bool> SaveRejectionAsync(DeveloperUniqueId id) { return _developerSaveRejection.Run(id); }
public Task<bool> SaveAcceptenceAsync(DeveloperUniqueId id) { return _developerSaveAcceptanceDoer.Run(id); }
public Task<Developer> GetByIdAsync(DeveloperUniqueId id) { return _developerGetByIdDoer.Run(id); }
public SubmitDeveloperCommand() { UniqueId = new DeveloperUniqueId(); Status = DeveloperStatus.New; }