예제 #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());
        }