public static ApiUserModel ApiUserToApiUserModel(ApiUser apiUser)
        {
            ApiUserModel apiUserModel = new ApiUserModel();
            apiUserModel.ApiUserId = apiUser.ApiUserId;
            apiUserModel.ApiKey = apiUser.ApiKey;
            apiUserModel.ApiCallCount = apiUser.ApiCallCount;
            apiUserModel.LastCallDate = apiUser.LastCallDate;
            apiUserModel.Email = apiUser.Email;
            apiUserModel.AppName = apiUser.AppName;

            return apiUserModel;
        }
        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;
        }
 /// <summary>
 /// Create a new ApiUser object.
 /// </summary>
 /// <param name="apiUserId">Initial value of the ApiUserId property.</param>
 /// <param name="apiKey">Initial value of the ApiKey property.</param>
 /// <param name="lastCallDate">Initial value of the LastCallDate property.</param>
 /// <param name="apiCallCount">Initial value of the ApiCallCount property.</param>
 /// <param name="appName">Initial value of the AppName property.</param>
 /// <param name="email">Initial value of the Email property.</param>
 public static ApiUser CreateApiUser(global::System.Int32 apiUserId, global::System.String apiKey, global::System.DateTime lastCallDate, global::System.Int32 apiCallCount, global::System.String appName, global::System.String email)
 {
     ApiUser apiUser = new ApiUser();
     apiUser.ApiUserId = apiUserId;
     apiUser.ApiKey = apiKey;
     apiUser.LastCallDate = lastCallDate;
     apiUser.ApiCallCount = apiCallCount;
     apiUser.AppName = appName;
     apiUser.Email = email;
     return apiUser;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the ApiUsers EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToApiUsers(ApiUser apiUser)
 {
     base.AddObject("ApiUsers", apiUser);
 }