예제 #1
0
        public async Task <T> Update <T>(IAccountManager accountManager, AccountManagerUpdateInput model)
            where T : AccountManagerOutput
        {
            var entity = await Repository.Queryable().FirstAsync(x => x.Id == accountManager.Id);

            return(await Update <T>(entity, model));
        }
예제 #2
0
        private async Task <T> Update <T>(AccountManager accountManager, AccountManagerUpdateInput model)
        {
            accountManager.InjectFrom(model);
            accountManager.Updated = DateTimeOffset.UtcNow;

            await Repository.UpdateAsync(accountManager, true);

            return(await Repository.Queryable().Where(x => x.Id == accountManager.Id)
                   .ProjectTo <T>(ProjectionMapping)
                   .FirstAsync());
        }
예제 #3
0
        public async Task <IActionResult> Update([FromBody] AccountManagerUpdateInput input)
        {
            var result = await _service.Update <AccountManagerDetailsOutput>(_principal, input);

            return(Ok(result));
        }