Exemplo n.º 1
0
        public async System.Threading.Tasks.Task <IHttpActionResult> Create(UserBlockModel model)
        {
            var reciepent = await this.AppUserManager.FindByNameAsync(model.RecipientName);

            if (reciepent == null)
            {
                throw new ApplicationException("User is not found");
            }
            model.RecipientId = reciepent.Id;
            _blockingService.BlockUser(model);
            return(Ok());
        }