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);
            }
        }
示例#3
0
        //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;
 }
示例#6
0
 public Task<bool> SaveRejectionAsync(DeveloperUniqueId id)
 {
     return _developerSaveRejection.Run(id);
 }
示例#7
0
 public Task<bool> SaveAcceptenceAsync(DeveloperUniqueId id)
 {
     return _developerSaveAcceptanceDoer.Run(id);
 }
示例#8
0
 public Task<Developer> GetByIdAsync(DeveloperUniqueId id)
 {
     return _developerGetByIdDoer.Run(id);
 }
示例#9
0
 public SubmitDeveloperCommand()
 {
     UniqueId = new DeveloperUniqueId();
     Status   = DeveloperStatus.New;
 }