public static IList<Loan> getUserLoanDetails(User user)
 {
     IList<Loan> loans;
     var loanquery = from loan in entity.Loans
                     where loan.user_id == user.id
                     select loan;
     loans = loanquery.ToList<Loan>();
     return loans;
 }
 /// < summary>
 /// Mehod to Save user details 
 /// </summary>
 public static void saveUser(string address,
     string name,
     string occupation,
     int phone,
     int income,
     int limit,
     string email,
     string role = "User")
 {
     Data.Address adds = new Data.Address();
     User user = new User();
     adds.address1 = address;
     entity.AddToAddresses(adds);
     user.name = name;
     user.occupation = occupation;
     user.phone = phone;
     user.presentaddr = adds.id;
     user.permenentaddr = adds.id;
     user.income = income;
     user.limit = limit;
     user.email = email;
     user.role = role;
     entity.AddToUsers(user);
     entity.SaveChanges();
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Users EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToUsers(User user)
 {
     base.AddObject("Users", user);
 }
 /// <summary>
 /// Create a new User object.
 /// </summary>
 /// <param name="id">Initial value of the id property.</param>
 /// <param name="name">Initial value of the name property.</param>
 /// <param name="permenentaddr">Initial value of the permenentaddr property.</param>
 /// <param name="presentaddr">Initial value of the presentaddr property.</param>
 /// <param name="role">Initial value of the role property.</param>
 public static User CreateUser(global::System.Int32 id, global::System.String name, global::System.Int32 permenentaddr, global::System.Int32 presentaddr, global::System.String role)
 {
     User user = new User();
     user.id = id;
     user.name = name;
     user.permenentaddr = permenentaddr;
     user.presentaddr = presentaddr;
     user.role = role;
     return user;
 }