Пример #1
0
        public async Task <DeveloperIds> Run(Developer dev)
        {
            var temp = _mapper.Map <DevloperTemp>(dev);

            temp.Status = 0;

            using var connection = new SQLiteConnection
                                       (_geekLemonContext.ConnectionString);

            var q = @"INSERT INTO Developers  (Name, UniqueId, Status) 
                VALUES (@Name, @UniqueId, @Status);
                SELECT seq From sqlite_sequence Where Name='Developers';";



            try
            {
                var result = await connection.QueryAsync <int>(q, temp);

                int createdId = result.FirstOrDefault();

                DeveloperIds ids = new DeveloperIds()
                {
                    CreatedId = new DeveloperId(createdId),
                    UniqueId  = dev.UniqueId
                };

                return(ids);
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
 public SubmitDeveloperCommandResponse(DeveloperIds ids)
     : base()
 {
     DeveloperIds = ids;
 }