コード例 #1
0
ファイル: UserService.svc.cs プロジェクト: KangChaofan/OOC
 public void Create(User user)
 {
     using (OOCEntities db = new OOCEntities())
     {
         try
         {
             db.User.AddObject(user);
             db.SaveChanges();
         }
         catch
         {
             throw new FaultException("TRANSACTION_FAILED");
         }
     }
 }
コード例 #2
0
ファイル: OOCModel.cs プロジェクト: KangChaofan/OOC
 /// <summary>
 /// Create a new User object.
 /// </summary>
 /// <param name="id">Initial value of the id property.</param>
 /// <param name="username">Initial value of the username property.</param>
 /// <param name="passhash">Initial value of the passhash property.</param>
 /// <param name="mobile">Initial value of the mobile property.</param>
 /// <param name="balance">Initial value of the balance property.</param>
 /// <param name="acl">Initial value of the acl property.</param>
 /// <param name="creation">Initial value of the creation property.</param>
 public static User CreateUser(global::System.Int64 id, global::System.String username, global::System.String passhash, global::System.String mobile, global::System.Double balance, global::System.String acl, global::System.DateTime creation)
 {
     User user = new User();
     user.id = id;
     user.username = username;
     user.passhash = passhash;
     user.mobile = mobile;
     user.balance = balance;
     user.acl = acl;
     user.creation = creation;
     return user;
 }
コード例 #3
0
ファイル: OOCModel.cs プロジェクト: KangChaofan/OOC
 /// <summary>
 /// Deprecated Method for adding a new object to the User EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToUser(User user)
 {
     base.AddObject("User", user);
 }