using System; using System.Collections.Generic; using System.Linq; using System.Text; using HeuristicLab.Services.Authentication.DataAccess; namespace Test { class Program { static void Main(string[] args) { ClientManagmentDataContext dc = new ClientManagmentDataContext(@"Data Source=nb-1\sqlexpress;Initial Catalog=HeuristicLab.ClientManagment;Integrated Security=SSPI;"); if (dc.DatabaseExists()) { Console.WriteLine("DB exsits"); dc.DeleteDatabase(); Console.WriteLine("DB deleted"); } Console.WriteLine("DB create"); dc.CreateDatabase(); Console.WriteLine("Finished"); Client c = new Client(); c.Id = Guid.NewGuid(); c.Name = "Eagle-Eye"; c.Description = "Development-PC"; c.IPAdress = "192.168.0.1"; //c.ResourceType = "Client"; ResourceGroup r = new ResourceGroup(); r.Name = "test"; ResourceResourceGroup rrg = new ResourceResourceGroup(); rrg.ResourceGroup = r; rrg.Client = c; dc.GetTable().InsertOnSubmit(r); dc.GetTable().InsertOnSubmit(c); dc.GetTable().InsertOnSubmit(rrg); dc.SubmitChanges(); } } }