Exemplo n.º 1
0
        public async Task <ActionResult> Index()
        {
            //string modelFile = Path.Combine(projectPath, @"bin\Debug\Bode.Services.Core.dll");
            //byte[] fileData = File.ReadAllBytes(modelFile);
            //Assembly assembly = Assembly.Load("Bode.Services.Core");
            //Type baseType = typeof(EntityBase<>);
            //IEnumerable<Type> modelTypes = assembly.GetTypes().Where(m => baseType.IsGenericAssignableFrom(m) && !m.IsAbstract && m.HasAttribute<GenerateAttribute>());

            ValidateCodeDto validate = new ValidateCodeDto()
            {
                CodeKey  = "15884517874",
                Code     = "123456",
                CodeType = CodeType.用户注册
            };

            //await UserContract.SaveValidateCodes(dtos: validate);
            int threadId1 = Thread.CurrentThread.ManagedThreadId;

            var codes = await UserContract.ValidateCodes.ToListAsync().ConfigureAwait(false);

            int threadId2 = Thread.CurrentThread.ManagedThreadId;

            string content = string.Format("start:{0};end:{1};", threadId1, threadId2);

            return(Content(content));
        }
Exemplo n.º 2
0
        public async Task<ActionResult> Index()
        {
            //string modelFile = Path.Combine(projectPath, @"bin\Debug\Bode.Services.Core.dll");
            //byte[] fileData = File.ReadAllBytes(modelFile);
            //Assembly assembly = Assembly.Load("Bode.Services.Core");
            //Type baseType = typeof(EntityBase<>);
            //IEnumerable<Type> modelTypes = assembly.GetTypes().Where(m => baseType.IsGenericAssignableFrom(m) && !m.IsAbstract && m.HasAttribute<GenerateAttribute>());

             ValidateCodeDto validate = new ValidateCodeDto()
             {
                 CodeKey = "15884517874",
                 Code = "123456",
                 CodeType = CodeType.用户注册
             };

            //await UserContract.SaveValidateCodes(dtos: validate);
            int threadId1 = Thread.CurrentThread.ManagedThreadId;

             var codes= await UserContract.ValidateCodes.ToListAsync().ConfigureAwait(false);

            int threadId2 = Thread.CurrentThread.ManagedThreadId;

            string content = string.Format("start:{0};end:{1};", threadId1, threadId2);
            return Content(content);
        }
Exemplo n.º 3
0
        public IHttpActionResult Post(ValidateCodeDto validateCodeDto)
        {
            if (!ModelState.IsValid)
            {
                var message = ModelState.BuildErrorMessage();
                throw new SimplePromptException(message);
            }
            _validateCodeFacadeService.SendCodeForValidateMobile(validateCodeDto.Mobile);
            var result = new TResult();

            return(Ok(result.SuccessResult()));
        }
Exemplo n.º 4
0
        public async Task <ActionResult> Index()
        {
            //string modelFile = Path.Combine(projectPath, @"bin\Debug\Bode.Services.Core.dll");
            //byte[] fileData = File.ReadAllBytes(modelFile);
            //Assembly assembly = Assembly.Load("Bode.Services.Core");
            //Type baseType = typeof(EntityBase<>);
            //IEnumerable<Type> modelTypes = assembly.GetTypes().Where(m => baseType.IsGenericAssignableFrom(m) && !m.IsAbstract && m.HasAttribute<GenerateAttribute>());

            ValidateCodeDto validate = new ValidateCodeDto()
            {
                PhoneNo  = "15884517874",
                Code     = "123456",
                CodeType = CodeType.用户注册
            };

            //await UserContract.SaveValidateCodes(dtos: validate);

            //var codes= UserContract.ValidateCodes.ToList();
            return(Content("as"));
        }
Exemplo n.º 5
0
        public async Task<ActionResult> Index()
        {
            //string modelFile = Path.Combine(projectPath, @"bin\Debug\Bode.Services.Core.dll");
            //byte[] fileData = File.ReadAllBytes(modelFile);
            //Assembly assembly = Assembly.Load("Bode.Services.Core");
            //Type baseType = typeof(EntityBase<>);
            //IEnumerable<Type> modelTypes = assembly.GetTypes().Where(m => baseType.IsGenericAssignableFrom(m) && !m.IsAbstract && m.HasAttribute<GenerateAttribute>());

             ValidateCodeDto validate = new ValidateCodeDto()
             {
                 PhoneNo = "15884517874",
                 Code = "123456",
                 CodeType = CodeType.用户注册
             };

             //await UserContract.SaveValidateCodes(dtos: validate);

             //var codes= UserContract.ValidateCodes.ToList();
             return Content("as");
        }