Exemplo n.º 1
0
        public async Task <ResponseModel> Post(SigninModel model)
        {
            IAuthenticationService signupService = new AuthenticationManager(new VirtualtraineesEntities());
            ResponseModel          response      = await signupService.Signin(model);

            return(response);
        }
Exemplo n.º 2
0
        public async Task <ResponseModel> Post(SignupModel model)
        {
            var context = new VirtualtraineesEntities();
            IAuthenticationService authenticationService = new AuthenticationManager(context);
            ResponseModel          response = authenticationService.Signup(model);

            if (response.IsSuccess)
            {
                var     emailer = new SendGridEmailer();
                Message message = EmailFactory.CreateMessage(new List <string>()
                {
                    model.Name
                },
                                                             new List <string>()
                {
                    model.Email
                }, EmailType.Welcome);
                var sent = await emailer.SendEmailAsync(message, new NetworkCredential("foyzulkarim", "Foysal.karim25"));
            }
            return(response);
        }