Exemplo n.º 1
0
        void generateEntities() //use connection param to modify the connection string and dbcontext;
        {                       //to continue
            string ip       = this.ServerIp;
            string username = this.ServerUsername;
            string password = this.ServerPassword;
            //Data Source=192.168.28.129;Initial Catalog=Dblibrary;Persist Security Info=True;User ID=sa;Password=19831122
            String sqlConnectionString       = "Data Source=" + ServerIp + ";Initial Catalog=Location;Persist Security Info=True;User ID=" + ServerUsername + ";Password="******"res://*/Models.Location.csdl|res://*/Models.Location.ssdl|res://*/Models.Location.msl";
            eb.Provider = "System.Data.SqlClient";
            eb.ProviderConnectionString   = sqlConnectionString;
            this.entitiesConnectionString = eb.ToString();
            this.dbEntities = new LocationEntities(this.entitiesConnectionString);
        }
Exemplo n.º 2
0
 public static void InsertLocation()
 {
     using (var context = new LocationEntities())
     {
         var park = new Park
         {
             Name    = "11th Street Park",
             Address = "801 11th Street",
             City    = "Aledo",
             State   = "TX",
             ZIPCode = "76106"
         };
         var loc = new Location
         {
             Address = "501 Main",
             City    = "Weatherford",
             State   = "TX",
             ZIPCode = "76201"
         };
         park.Office = loc;
         context.Locations.Add(park);
         context.SaveChanges();
     }
 }
Exemplo n.º 3
0
 public bool UpdateLocation(int LocationId, LocationEntities LocationEntities)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 4
0
 public int CreateLocation(LocationEntities LocationEntities)
 {
     throw new NotImplementedException();
 }