コード例 #1
0
        public override bool Execute()
        {
            CreateApiUserModel caum = new CreateApiUserModel();
            caum.ApiKey = apiServices.GenerateApiKey();
            caum.Email = "*****@*****.**";
            caum.AppName = "App-" + random.Next(1000);

            return apiServices.CreateApiUser(caum);
        }
コード例 #2
0
        public bool CreateApiUser(CreateApiUserModel caum)
        {
            ApiUser apiUser = new ApiUser();
            apiUser.ApiKey = caum.ApiKey;
            apiUser.Email = caum.Email;
            apiUser.AppName = caum.AppName;
            apiUser.LastCallDate = DateTime.Now;
            apiUser.ApiCallCount = 0;

            db.AddToApiUsers(apiUser);
            db.SaveChanges();

            return true;
        }