Пример #1
0
        public void UpdatesUser()
        {
            var user = new User {
            };

            command.Execute(user);

            sqlExecutor
            .Verify(x => x.ExecuteNonQuery(It.Is <string>(y => y.Contains("UPDATE Users"))));
        }
Пример #2
0
 public void Update <T>(
     T entity,
     dynamic condition = null) where T : class
 {
     updateCommand.Execute <T>(
         entity: entity,
         condition: condition);
 }
Пример #3
0
 public T Update <T>(IUpdateCommand <T> command)
 {
     if (command.RequiresTransaction && _transaction == null)
     {
         throw new Exception($"The command {command.GetType()} requires a transaction");
     }
     return(Retry.Invoke(() => command.Execute(_connection, _transaction), _options));
 }
Пример #4
0
        public async Task <IActionResult> Put([FromRoute] Guid id,
                                              [FromRoute] string name,
                                              [FromRoute] string value,
                                              [FromServices] IUpdateCommand <Guid, Story> updateStoryCommand)
        {
            await updateStoryCommand.Execute(id, name, value);

            return(Ok());
        }
Пример #5
0
        public async Task <IActionResult> Put([FromRoute] Guid storyId,
                                              [FromRoute] int id,
                                              [FromRoute] string name,
                                              [FromRoute] string value,
                                              [FromServices] IUpdateCommand <Guid, int, Option> updateCommand)
        {
            await updateCommand.Execute(storyId, id, name, value);

            return(Ok());
        }
Пример #6
0
        public async Task <IActionResult> Put(
            [FromRoute] Guid storyId,
            [FromRoute] int featureId,
            [FromRoute] int optionId,
            [FromRoute] OptionValueType type,
            [FromRoute] string value,
            [FromServices] IUpdateCommand <Guid, int, int, OptionValueType, OptionValue> updateCommand)
        {
            await updateCommand.Execute(storyId, featureId, optionId, type, "Value", value);

            return(Ok());
        }