//============================================================ // // //============================================================ void IWorkspaces.Save(EWorkspace workspace) { using(AgoraDataContext DB = new AgoraDataContext()) { SWorkspace dbWorkspace = DB.Workspaces.Single(o=>o.WorkspaceID==workspace.WorkspaceID); dbWorkspace.UpdatedOn = DateTime.UtcNow; dbWorkspace.UpdatedBy = 0; dbWorkspace.Name = workspace.Name; dbWorkspace.Description = workspace.Description; DB.SaveChanges(); } }
//============================================================ // // //============================================================ EWorkspace IWorkspaces.Load() { using(AgoraDataConte//gElements.Add(new EWorkspaceElement() { Data = "SERVER1" }); //gElements.Add(new EWorkspaceElement() { Data = "SERVER2" }); //gElements.Add(new EWorkspaceElement() { Data = "SERVER3" }); new AgoraDataContext()) { SWorkspace dbWorkspace = DB.Workspaces.Single(o=>o.WorkspaceID==workspace.Workspac EWorkspace oWorkspace = new EWorkspace() { WorkspaceID = dbWorkspace.WorkspaceID, Name = dbWorkspace.Name, Description = dbWorkspace.Description }; return oWorkspace; } }