public static void Add(AppUser user) { if (users.SingleOrDefault(u => u.FacebookId == user.FacebookId) != null) { throw new InvalidOperationException("User already exists."); } users.Add(user); }
public static AppUser CreateAppUser(long fbId) { AppUser appUser = new AppUser(); appUser.FacebookId = fbId; appUser.Points = double.Parse(System.Configuration.ConfigurationManager.AppSettings["InitialCredit"]); appUser.LastVisited = DateTime.Now; //appUser.TimesPlayed = 0; //appUser.JackPotCount = 0; //appUser.TotalInvitationSent = 0; //appUser.InvitationSentToday = 0; return appUser; }
/// <summary> /// Deprecated Method for adding a new object to the AppUsers EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToAppUsers(AppUser appUser) { base.AddObject("AppUsers", appUser); }
/// <summary> /// Create a new AppUser object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="facebookId">Initial value of the FacebookId property.</param> /// <param name="points">Initial value of the Points property.</param> /// <param name="lastVisited">Initial value of the LastVisited property.</param> /// <param name="timesPlayed">Initial value of the TimesPlayed property.</param> /// <param name="jackPotCount">Initial value of the JackPotCount property.</param> /// <param name="totalInvitationSent">Initial value of the TotalInvitationSent property.</param> /// <param name="invitationSentToday">Initial value of the InvitationSentToday property.</param> public static AppUser CreateAppUser(global::System.Int64 id, global::System.Int64 facebookId, global::System.Double points, global::System.DateTime lastVisited, global::System.Int32 timesPlayed, global::System.Int32 jackPotCount, global::System.Int32 totalInvitationSent, global::System.Int32 invitationSentToday) { AppUser appUser = new AppUser(); appUser.Id = id; appUser.FacebookId = facebookId; appUser.Points = points; appUser.LastVisited = lastVisited; appUser.TimesPlayed = timesPlayed; appUser.JackPotCount = jackPotCount; appUser.TotalInvitationSent = totalInvitationSent; appUser.InvitationSentToday = invitationSentToday; return appUser; }