Index: /branches/UserManagement/HeuristicLab.Authentication.sln
===================================================================
--- /branches/UserManagement/HeuristicLab.Authentication.sln	(revision 4739)
+++ /branches/UserManagement/HeuristicLab.Authentication.sln	(revision 4740)
@@ -16,4 +16,6 @@
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Services.Authentication.TestClient", "HeuristicLab.Services.Authentication.TestClient\HeuristicLab.Services.Authentication.TestClient.csproj", "{C31A4169-0BD0-4969-A85B-49AA3B679047}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Services.Authentication.TestClient2", "HeuristicLab.Services.Authentication.TestClient2\HeuristicLab.Services.Authentication.TestClient2.csproj", "{EB40C828-D545-4DFE-9CE6-108FB03C6912}"
 EndProject
 Global
@@ -70,4 +72,14 @@
 		{C31A4169-0BD0-4969-A85B-49AA3B679047}.Release|x86.ActiveCfg = Release|x86
 		{C31A4169-0BD0-4969-A85B-49AA3B679047}.Release|x86.Build.0 = Release|x86
+		{EB40C828-D545-4DFE-9CE6-108FB03C6912}.Debug|Any CPU.ActiveCfg = Debug|x86
+		{EB40C828-D545-4DFE-9CE6-108FB03C6912}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+		{EB40C828-D545-4DFE-9CE6-108FB03C6912}.Debug|Mixed Platforms.Build.0 = Debug|x86
+		{EB40C828-D545-4DFE-9CE6-108FB03C6912}.Debug|x86.ActiveCfg = Debug|x86
+		{EB40C828-D545-4DFE-9CE6-108FB03C6912}.Debug|x86.Build.0 = Debug|x86
+		{EB40C828-D545-4DFE-9CE6-108FB03C6912}.Release|Any CPU.ActiveCfg = Release|x86
+		{EB40C828-D545-4DFE-9CE6-108FB03C6912}.Release|Mixed Platforms.ActiveCfg = Release|x86
+		{EB40C828-D545-4DFE-9CE6-108FB03C6912}.Release|Mixed Platforms.Build.0 = Release|x86
+		{EB40C828-D545-4DFE-9CE6-108FB03C6912}.Release|x86.ActiveCfg = Release|x86
+		{EB40C828-D545-4DFE-9CE6-108FB03C6912}.Release|x86.Build.0 = Release|x86
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
Index: /branches/UserManagement/HeuristicLab.Services.Authentication.DataAccess/HeuristicLab.Services.Authentication.DataAccess.csproj
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.DataAccess/HeuristicLab.Services.Authentication.DataAccess.csproj	(revision 4739)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication.DataAccess/HeuristicLab.Services.Authentication.DataAccess.csproj	(revision 4740)
@@ -52,13 +52,11 @@
       <DependentUpon>Settings.settings</DependentUpon>
     </Compile>
+    <Compile Include="UserManagement.cs">
+      <DependentUpon>UserManagement.dbml</DependentUpon>
+    </Compile>
     <Compile Include="UserManagement.designer.cs">
       <AutoGen>True</AutoGen>
       <DesignTime>True</DesignTime>
       <DependentUpon>UserManagement.dbml</DependentUpon>
-    </Compile>
-    <Compile Include="_HeuristicLab_AuthenticationDataSet.Designer.cs">
-      <AutoGen>True</AutoGen>
-      <DesignTime>True</DesignTime>
-      <DependentUpon>_HeuristicLab_AuthenticationDataSet.xsd</DependentUpon>
     </Compile>
   </ItemGroup>
@@ -73,15 +71,4 @@
       <LastGenOutput>UserManagement.designer.cs</LastGenOutput>
       <SubType>Designer</SubType>
-    </None>
-    <None Include="_HeuristicLab_AuthenticationDataSet.xsc">
-      <DependentUpon>_HeuristicLab_AuthenticationDataSet.xsd</DependentUpon>
-    </None>
-    <None Include="_HeuristicLab_AuthenticationDataSet.xsd">
-      <Generator>MSDataSetGenerator</Generator>
-      <LastGenOutput>_HeuristicLab_AuthenticationDataSet.Designer.cs</LastGenOutput>
-      <SubType>Designer</SubType>
-    </None>
-    <None Include="_HeuristicLab_AuthenticationDataSet.xss">
-      <DependentUpon>_HeuristicLab_AuthenticationDataSet.xsd</DependentUpon>
     </None>
   </ItemGroup>
Index: /branches/UserManagement/HeuristicLab.Services.Authentication.DataTransfer/Application.cs
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.DataTransfer/Application.cs	(revision 4739)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication.DataTransfer/Application.cs	(revision 4740)
@@ -7,15 +7,21 @@
 namespace HeuristicLab.Services.Authentication.DataTransfer
 {
-    [DataContract]
-    public class Application
-    {
-        [DataMember]
-        public Guid ApplicationId { get; set; }
-        [DataMember]
-        public string ApplicationName { get; set; }
-        [DataMember]
-        public string LoweredApplicationName { get; set; }
-        [DataMember]
-        public string Description { get; set; }
-    }
+  [DataContract]
+  public class Application : NamedAuthItem {
+    //[DataMember]
+    //public string LoweredApplicationName { get; set; }
+    [DataMember]
+    public string Description { get; set; }
+  }
+    //[DataContract]
+    //public class Application : NamedAuthItem {
+    //    [DataMember]
+    //    public Guid ApplicationId { get; set; }
+    //    [DataMember]
+    //    public string ApplicationName { get; set; }
+    //    [DataMember]
+    //    public string LoweredApplicationName { get; set; }
+    //    [DataMember]
+    //    public string Description { get; set; }
+    //}
 }
Index: /branches/UserManagement/HeuristicLab.Services.Authentication.DataTransfer/HeuristicLab.Services.Authentication.DataTransfer.csproj
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.DataTransfer/HeuristicLab.Services.Authentication.DataTransfer.csproj	(revision 4739)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication.DataTransfer/HeuristicLab.Services.Authentication.DataTransfer.csproj	(revision 4740)
@@ -43,6 +43,7 @@
   <ItemGroup>
     <Compile Include="Application.cs" />
+    <Compile Include="AuthItem.cs" />
+    <Compile Include="NamedAuthItem.cs" />
     <Compile Include="Role.cs" />
-    <Compile Include="Membership.cs" />
     <Compile Include="User.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
Index: /branches/UserManagement/HeuristicLab.Services.Authentication.DataTransfer/Role.cs
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.DataTransfer/Role.cs	(revision 4739)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication.DataTransfer/Role.cs	(revision 4740)
@@ -7,17 +7,26 @@
 namespace HeuristicLab.Services.Authentication.DataTransfer
 {
-    [DataContract]
-    public class Role
-    {
-        [DataMember]
-        public Guid ApplicationId { get; set; }
-        [DataMember]
-        public Guid RoleId { get; set; }
-        [DataMember]
-        public string RoleName { get; set; }
-        [DataMember]
-        public string LoweredRoleName { get; set; }
-        [DataMember]
-        public string Description { get; set; }
-    }
+  [DataContract]
+  public class Role : NamedAuthItem {
+    [DataMember]
+    public Guid ApplicationId { get; set; }
+    //[DataMember]
+    //public string LoweredRoleName { get; set; }
+    [DataMember]
+    public string Desciption { get; set; }
+  }
+    //[DataContract]
+    //public class Role
+    //{
+    //    [DataMember]
+    //    public Guid ApplicationId { get; set; }
+    //    [DataMember]
+    //    public Guid RoleId { get; set; }
+    //    [DataMember]
+    //    public string RoleName { get; set; }
+    //    [DataMember]
+    //    public string LoweredRoleName { get; set; }
+    //    [DataMember]
+    //    public string Description { get; set; }
+    //}
 }
Index: /branches/UserManagement/HeuristicLab.Services.Authentication.DataTransfer/User.cs
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.DataTransfer/User.cs	(revision 4739)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication.DataTransfer/User.cs	(revision 4740)
@@ -7,49 +7,106 @@
 namespace HeuristicLab.Services.Authentication.DataTransfer
 {
-    [DataContract]
-    public class User
-    {
+  [DataContract]
+  public class User : NamedAuthItem {
+    // Member of Membership
+    [DataMember]
+    public Guid ApplicationId { get; set; } // Membership
+    [DataMember]
+    public string Password { get; set; } // Membership
+    //[DataMember]
+    //public string PasswordFormat { get; set; } // Membership
+    [DataMember]
+    public string PasswordSalt { get; set; } // Membership
+    //[DataMember]
+    //public string MobilePIN { get; set; } // Membership
+    [DataMember]
+    public string Email { get; set; } // Membership
+    //[DataMember]
+    //public string LoweredEmail { get; set; } // Membership
+    //[DataMember]
+    //public string PasswordQuestion { get; set; } // Membership
+    //[DataMember]
+    //public string PasswordAnswer { get; set; } // Membership
+    [DataMember]
+    public bool IsApproved { get; set; } // Membership
+    [DataMember]
+    public bool IsLookedOut { get; set; } // Membership
+    [DataMember]
+    public DateTime CreateDate { get; set; } // Membership
+    [DataMember]
+    public DateTime LastLoginDate { get; set; } // Membership
+    [DataMember]
+    public DateTime LastPasswordChangeDate { get; set; } // Memership
+    [DataMember]
+    public DateTime LastLockoutDate { get; set; } // Membership
+    //[DataMember]
+    //public int FailedPasswordAttemptCount { get; set; } // Membership
+    //[DataMember]
+    //public DateTime FailedPasswordAttemptWindowStart { get; set; } // Membership
+    //[DataMember]
+    //public int FailedPasswordAnswerAttemptCount { get; set; } // Membership
+    //[DataMember]
+    //public DateTime FailedPasswordAnswerAttemptWindowStart { get; set; } // Membership
+    [DataMember]
+    public string Comment { get; set; } // Membership
+    // Members of User
+    //[DataMember]
+    //public string LoweredUserName { get; set; } // User
+    //[DataMember]
+    //public string MobileAlias { get; set; } // User
+    //[DataMember]
+    //public bool IsAnonymous { get; set; } // User
+    [DataMember]
+    public DateTime LastActivityDate { get; set; } // User
 
-        public User()
-        {
-            Membership = new Membership();
-        }
+  }
 
-        [DataMember]
-        public Membership Membership { get; set; }
 
-        [DataMember]
-        public string Email
-        {
-            get { return Membership.Email; }
-            set { Membership.Email = value; }
-        }
-        [DataMember]
-        public string Password
-        {
-            get { return Membership.Password; }
-            set { Membership.Password = value; }
-        }
-        [DataMember]
-        public string PasswordQuestion
-        {
-            get { return Membership.PasswordQuestion; }
-            set { this.Membership.PasswordQuestion = value; }
-        }
-        [DataMember]
-        public Guid ApplicationId { get; set; }
-        [DataMember]
-        public Guid UserId { get; set; }
-        [DataMember]
-        public string UserName { get; set; }
-        [DataMember]
-        public string LoweredUserName { get; set; }
-        [DataMember]
-        public string MobileAlias { get; set; }
-        [DataMember]
-        public bool IsAnonymous { get; set; }
-        [DataMember]
-        public DateTime LastActivityDate { get; set; }
 
-    }
+    //[DataContract]
+    //public class User
+    //{
+
+    //    public User()
+    //    {
+    //        Membership = new Membership();
+    //    }
+
+    //    [DataMember]
+    //    public Membership Membership { get; set; }
+
+    //    [DataMember]
+    //    public string Email
+    //    {
+    //        get { return Membership.Email; }
+    //        set { Membership.Email = value; }
+    //    }
+    //    [DataMember]
+    //    public string Password
+    //    {
+    //        get { return Membership.Password; }
+    //        set { Membership.Password = value; }
+    //    }
+    //    [DataMember]
+    //    public string PasswordQuestion
+    //    {
+    //        get { return Membership.PasswordQuestion; }
+    //        set { this.Membership.PasswordQuestion = value; }
+    //    }
+    //    [DataMember]
+    //    public Guid ApplicationId { get; set; }
+    //    [DataMember]
+    //    public Guid UserId { get; set; }
+    //    [DataMember]
+    //    public string UserName { get; set; }
+    //    [DataMember]
+    //    public string LoweredUserName { get; set; }
+    //    [DataMember]
+    //    public string MobileAlias { get; set; }
+    //    [DataMember]
+    //    public bool IsAnonymous { get; set; }
+    //    [DataMember]
+    //    public DateTime LastActivityDate { get; set; }
+
+    //}
 }
Index: /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/HeuristicLab.Services.Authentication.TestClient.csproj
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/HeuristicLab.Services.Authentication.TestClient.csproj	(revision 4739)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/HeuristicLab.Services.Authentication.TestClient.csproj	(revision 4740)
@@ -75,5 +75,5 @@
   </ItemGroup>
   <ItemGroup>
-    <None Include="Properties\DataSources\HeuristicLab.Services.Authentication.DataTransfer.Application.datasource" />
+    <None Include="Properties\DataSources\HeuristicLab.Services.Authentication.DataTransfer.Membership.datasource" />
     <None Include="Properties\DataSources\HeuristicLab.Services.Authentication.DataTransfer.Role.datasource" />
     <None Include="Properties\DataSources\HeuristicLab.Services.Authentication.DataTransfer.User.datasource" />
Index: /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/TestClient.cs
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/TestClient.cs	(revision 4739)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/TestClient.cs	(revision 4740)
@@ -20,4 +20,5 @@
             {
 
+
                 //Console.WriteLine("Insert new application");
                 //Application app1 = new Application() { ApplicationName="SPR Application", Description="SPR Application"};
Index: /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/UserManagement.Designer.cs
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/UserManagement.Designer.cs	(revision 4739)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/UserManagement.Designer.cs	(revision 4740)
@@ -47,4 +47,7 @@
             this.btnNewUser = new System.Windows.Forms.Button();
             this.dgvUsers = new System.Windows.Forms.DataGridView();
+            this.userNameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.isAnonymousDataGridViewCheckBoxColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.Membership = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.bsUsers = new System.Windows.Forms.BindingSource(this.components);
             this.tcUser = new System.Windows.Forms.TabControl();
@@ -82,7 +85,4 @@
             this.userNameDataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.bsUserRoles = new System.Windows.Forms.BindingSource(this.components);
-            this.Membership = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.isAnonymousDataGridViewCheckBoxColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.userNameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
             roleNameLabel = new System.Windows.Forms.Label();
             descriptionLabel = new System.Windows.Forms.Label();
@@ -223,4 +223,5 @@
             // 
             this.bsApplications.DataSource = typeof(HeuristicLab.Services.Authentication.DataTransfer.Application);
+            this.bsApplications.CurrentChanged += new System.EventHandler(this.bsApplications_CurrentChanged);
             // 
             // label1
@@ -297,4 +298,25 @@
             this.dgvUsers.TabIndex = 1;
             this.dgvUsers.SelectionChanged += new System.EventHandler(this.dgvUsers_SelectionChanged);
+            // 
+            // userNameDataGridViewTextBoxColumn
+            // 
+            this.userNameDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+            this.userNameDataGridViewTextBoxColumn.DataPropertyName = "UserName";
+            this.userNameDataGridViewTextBoxColumn.HeaderText = "UserName";
+            this.userNameDataGridViewTextBoxColumn.Name = "userNameDataGridViewTextBoxColumn";
+            // 
+            // isAnonymousDataGridViewCheckBoxColumn
+            // 
+            this.isAnonymousDataGridViewCheckBoxColumn.DataPropertyName = "IsAnonymous";
+            this.isAnonymousDataGridViewCheckBoxColumn.HeaderText = "IsAnonymous";
+            this.isAnonymousDataGridViewCheckBoxColumn.Name = "isAnonymousDataGridViewCheckBoxColumn";
+            // 
+            // Membership
+            // 
+            this.Membership.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
+            this.Membership.DataPropertyName = "Membership.Email";
+            this.Membership.HeaderText = "EMail";
+            this.Membership.Name = "Membership";
+            this.Membership.Width = 58;
             // 
             // bsUsers
@@ -632,25 +654,4 @@
             // 
             this.bsUserRoles.DataSource = typeof(HeuristicLab.Services.Authentication.DataTransfer.Role);
-            // 
-            // Membership
-            // 
-            this.Membership.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
-            this.Membership.DataPropertyName = "Membership.Email";
-            this.Membership.HeaderText = "EMail";
-            this.Membership.Name = "Membership";
-            this.Membership.Width = 58;
-            // 
-            // isAnonymousDataGridViewCheckBoxColumn
-            // 
-            this.isAnonymousDataGridViewCheckBoxColumn.DataPropertyName = "IsAnonymous";
-            this.isAnonymousDataGridViewCheckBoxColumn.HeaderText = "IsAnonymous";
-            this.isAnonymousDataGridViewCheckBoxColumn.Name = "isAnonymousDataGridViewCheckBoxColumn";
-            // 
-            // userNameDataGridViewTextBoxColumn
-            // 
-            this.userNameDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
-            this.userNameDataGridViewTextBoxColumn.DataPropertyName = "UserName";
-            this.userNameDataGridViewTextBoxColumn.HeaderText = "UserName";
-            this.userNameDataGridViewTextBoxColumn.Name = "userNameDataGridViewTextBoxColumn";
             // 
             // UserManagement
Index: /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/UserManagement.cs
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/UserManagement.cs	(revision 4739)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/UserManagement.cs	(revision 4740)
@@ -179,4 +179,9 @@
         }
 
+        private void bsApplications_CurrentChanged(object sender, EventArgs e)
+        {
+
+        }
+
     
 
Index: /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/UserManagement.resx
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/UserManagement.resx	(revision 4739)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/UserManagement.resx	(revision 4740)
@@ -139,4 +139,7 @@
     <value>False</value>
   </metadata>
+  <metadata name="bsApplications.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 56</value>
+  </metadata>
   <metadata name="Membership.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
@@ -145,9 +148,9 @@
     <value>17, 17</value>
   </metadata>
-  <metadata name="bsApplications.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>17, 56</value>
+  <metadata name="Membership.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
   </metadata>
-  <metadata name="bsApplications.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>17, 56</value>
+  <metadata name="bsUsers.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
   </metadata>
   <metadata name="bsUser.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
Index: /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient2/HeuristicLab.Services.Authentication.TestClient2.csproj
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient2/HeuristicLab.Services.Authentication.TestClient2.csproj	(revision 4740)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient2/HeuristicLab.Services.Authentication.TestClient2.csproj	(revision 4740)
@@ -0,0 +1,67 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+    <ProductVersion>8.0.30703</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{EB40C828-D545-4DFE-9CE6-108FB03C6912}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Services.Authentication.TestClient2</RootNamespace>
+    <AssemblyName>HeuristicLab.Services.Authentication.TestClient2</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <TargetFrameworkProfile>Client</TargetFrameworkProfile>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <PlatformTarget>x86</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <PlatformTarget>x86</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\HeuristicLab.Services.Authentication.DataTransfer\HeuristicLab.Services.Authentication.DataTransfer.csproj">
+      <Project>{AC44BDF4-AED7-4445-9A99-57B3237DBE88}</Project>
+      <Name>HeuristicLab.Services.Authentication.DataTransfer</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\HeuristicLab.Services.Authentication\HeuristicLab.Services.Authentication.csproj">
+      <Project>{FF763830-EE9B-4FF7-9A55-4E2552E20C9A}</Project>
+      <Name>HeuristicLab.Services.Authentication</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
Index: /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient2/Program.cs
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient2/Program.cs	(revision 4740)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient2/Program.cs	(revision 4740)
@@ -0,0 +1,30 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Services.Authentication.DataTransfer;
+
+namespace HeuristicLab.Services.Authentication.TestClient2 {
+  class Program {
+    static void Main(string[] args) {
+
+      AuthenticationService auth = new AuthenticationService();
+
+
+      Console.WriteLine("Find User with GUID: 0938331f-847e-4361-8ef0-a84e5a8b121c");
+      Guid userguid = Guid.Parse("0938331f-847e-4361-8ef0-a84e5a8b121c");
+      User user = auth.GetUser(userguid);
+
+      if (user != null) {
+        Console.WriteLine("Username of User: {0}", user.Name);
+      } else {
+        Console.WriteLine("User not found!");
+      }
+
+      Console.ReadLine();
+
+
+
+    }
+  }
+}
Index: /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient2/Properties/AssemblyInfo.cs
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient2/Properties/AssemblyInfo.cs	(revision 4740)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient2/Properties/AssemblyInfo.cs	(revision 4740)
@@ -0,0 +1,36 @@
+﻿using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.Services.Authentication.TestClient2")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("HeuristicLab.Services.Authentication.TestClient2")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("6c66e883-e3e6-4b73-b3ca-cae5486d2cd9")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
Index: /branches/UserManagement/HeuristicLab.Services.Authentication/AuthenticationService.cs
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication/AuthenticationService.cs	(revision 4739)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication/AuthenticationService.cs	(revision 4740)
@@ -19,764 +19,762 @@
             using (UserManagementDataContext db = new UserManagementDataContext())
             {
-                try
-                {
-                    Table<aspnet_User> UserTable = db.GetTable<aspnet_User>();
-
-                    var User = from item in UserTable
-                               where item.UserId == id
-                               select item;
-                    aspnet_User eUser = User.Single();
-
-                    User user = Convert.ToDataTransfer((aspnet_User)eUser);
-
-                    if (user == null) { return null; }
-
-                    //Table<aspnet_Membership> MembershipTable = db.GetTable<aspnet_Membership>();
-
-                    //var Membership = from item in MembershipTable
-                    //                 where item.UserId == id
-                    //                 select item;
-
-                    Membership membership = Convert.ToDataTransfer((aspnet_Membership)eUser.aspnet_Membership);
-
-                    if (membership == null) { return null; }
-                    user.Membership = membership;
-
-                    return user;
-
-
-                }
-                catch (Exception ex)
-                {
-                    Debug.WriteLine(ex.InnerException);
-                    return null;
-                }
+                  var user = db.aspnet_Users.Where(x => x.UserId == id).FirstOrDefault();
+                  var membership = db.aspnet_Memberships.Where(x => x.UserId == id).FirstOrDefault();
+                    
+
+                  return Convert.ToDataTransfer(user, membership);
+                  //Table<aspnet_User> UserTable = db.GetTable<aspnet_User>();
+
+                  //var User = from item in UserTable
+                  //           where item.UserId == id
+                  //           select item;
+                  //aspnet_User eUser = User.Single();
+
+                  //User user = Convert.ToDataTransfer((aspnet_User)eUser);
+
+                  //if (user == null) { return null; }
+
+                  //Table<aspnet_Membership> MembershipTable = db.GetTable<aspnet_Membership>();
+
+                  //var Membership = from item in MembershipTable
+                  //                 where item.UserId == id
+                  //                 select item;
+
+                  //Membership membership = Convert.ToDataTransfer((aspnet_Membership)eUser.aspnet_Membership);
+
+                  //if (membership == null) { return null; }
+                  //user.Membership = membership;
+
+                  //return user;
+
             }
-        }
-
-        public DataTransfer.User GetUser(Guid applicationId, string userName)
-        {
-            using (UserManagementDataContext db = new UserManagementDataContext())
-            {
-                try
-                {
-                    Table<aspnet_User> UserTable = db.GetTable<aspnet_User>();
-
-                    var User = from item in UserTable
-                               where item.UserName == userName && item.ApplicationId == applicationId
-                               select item;
-
-                    User user = Convert.ToDataTransfer((aspnet_User)User.Single());
-
-                    if (user == null) { return null; }
-
-                    Table<aspnet_Membership> MembershipTable = db.GetTable<aspnet_Membership>();
-
-                    var Membership = from item in MembershipTable
-                                     where item.UserId == user.UserId
-                                     select item;
-
-                    Membership membership = Convert.ToDataTransfer((aspnet_Membership)Membership.Single());
-
-                    if (membership == null) { return null; }
-                    user.Membership = membership;
-
-                    return user;
-
-
-
-
-                }
-                catch (Exception ex)
-                {
-                    Debug.WriteLine(ex.InnerException);
-                    return null;
-                }
-               }
-        }
-
-        public IEnumerable<DataTransfer.User> GetUsers(Guid applicationId)
-        {
-            List<DataTransfer.User> UserList = new List<DataTransfer.User>();
-            using (UserManagementDataContext db = new UserManagementDataContext())
-            {
-                try
-                {
-                    Table<aspnet_User> UserTable = db.GetTable<aspnet_User>();
-                    var Users = from item in UserTable
-                                where item.ApplicationId == applicationId
-                                select item;
-                    foreach (var eUser in Users)
-                    {
-
-                        User user = Convert.ToDataTransfer(eUser);
-
-                        if (user== null) { return null; }
-
-                        //Table<aspnet_Membership> MembershipTable = db.GetTable<aspnet_Membership>();
-
-                        //var Membership = from item in MembershipTable
-                        //                 where item.UserId == user.UserId
-                        //                 select item;
-
-                        Membership membership = Convert.ToDataTransfer((aspnet_Membership)eUser.aspnet_Membership);
-
-                        if (membership == null) { return null; }
-                        user.Membership = membership;
-
-                        UserList.Add(user);
-                    }
-                }
-                catch (Exception ex)
-                {
-                    Debug.WriteLine(ex.InnerException);
-                    return new List<User>();
-                }
-            }
-
-            return UserList;
-        }
-        public bool InsertUser(User user)
-        {
-            if (user != null)
-            {
-                using (UserManagementDataContext db = new UserManagementDataContext())
-                {
-                    try
-                    {
-
-                        Guid? userId = null;
-                        Application application = GetApplication(user.ApplicationId);
-                        if(application == null){return false;}
-                        if (user.Membership == null) { return false; }
+      }
+
+        #endregion
+
+
+      //public DataTransfer.User GetUser(Guid applicationId, string userName)
+        //{
+        //    using (UserManagementDataContext db = new UserManagementDataContext())
+        //    {
+        //        try
+        //        {
+        //            Table<aspnet_User> UserTable = db.GetTable<aspnet_User>();
+
+        //            var User = from item in UserTable
+        //                       where item.UserName == userName && item.ApplicationId == applicationId
+        //                       select item;
+
+        //            User user = Convert.ToDataTransfer((aspnet_User)User.Single());
+
+        //            if (user == null) { return null; }
+
+        //            Table<aspnet_Membership> MembershipTable = db.GetTable<aspnet_Membership>();
+
+        //            var Membership = from item in MembershipTable
+        //                             where item.UserId == user.UserId
+        //                             select item;
+
+        //            Membership membership = Convert.ToDataTransfer((aspnet_Membership)Membership.Single());
+
+        //            if (membership == null) { return null; }
+        //            user.Membership = membership;
+
+        //            return user;
+
+
+
+
+        //        }
+        //        catch (Exception ex)
+        //        {
+        //            Debug.WriteLine(ex.InnerException);
+        //            return null;
+        //        }
+        //       }
+        //}
+
+        //public IEnumerable<DataTransfer.User> GetUsers(Guid applicationId)
+        //{
+        //    List<DataTransfer.User> UserList = new List<DataTransfer.User>();
+        //    using (UserManagementDataContext db = new UserManagementDataContext())
+        //    {
+        //        try
+        //        {
+        //            Table<aspnet_User> UserTable = db.GetTable<aspnet_User>();
+        //            var Users = from item in UserTable
+        //                        where item.ApplicationId == applicationId
+        //                        select item;
+        //            foreach (var eUser in Users)
+        //            {
+
+        //                User user = Convert.ToDataTransfer(eUser);
+
+        //                if (user== null) { return null; }
+
+        //                //Table<aspnet_Membership> MembershipTable = db.GetTable<aspnet_Membership>();
+
+        //                //var Membership = from item in MembershipTable
+        //                //                 where item.UserId == user.UserId
+        //                //                 select item;
+
+        //                Membership membership = Convert.ToDataTransfer((aspnet_Membership)eUser.aspnet_Membership);
+
+        //                if (membership == null) { return null; }
+        //                user.Membership = membership;
+
+        //                UserList.Add(user);
+        //            }
+        //        }
+        //        catch (Exception ex)
+        //        {
+        //            Debug.WriteLine(ex.InnerException);
+        //            return new List<User>();
+        //        }
+        //    }
+
+        //    return UserList;
+        //}
+        //public bool InsertUser(User user)
+        //{
+        //    if (user != null)
+        //    {
+        //        using (UserManagementDataContext db = new UserManagementDataContext())
+        //        {
+        //            try
+        //            {
+
+        //                Guid? userId = null;
+        //                Application application = GetApplication(user.ApplicationId);
+        //                if(application == null){return false;}
+        //                if (user.Membership == null) { return false; }
     
-                        int? passwordFormat = 1;
-                        int? uniqueEmail = null;
-                        int result = db.aspnet_Membership_CreateUser(application.ApplicationName, user.UserName, user.Membership.Password, user.Membership.PasswordSalt, user.Membership.Email, user.Membership.PasswordQuestion, user.Membership.PasswordAnswer, user.Membership.IsApproved, DateTime.UtcNow, DateTime.Now, uniqueEmail, passwordFormat, ref userId);
+        //                int? passwordFormat = 1;
+        //                int? uniqueEmail = null;
+        //                int result = db.aspnet_Membership_CreateUser(application.ApplicationName, user.UserName, user.Membership.Password, user.Membership.PasswordSalt, user.Membership.Email, user.Membership.PasswordQuestion, user.Membership.PasswordAnswer, user.Membership.IsApproved, DateTime.UtcNow, DateTime.Now, uniqueEmail, passwordFormat, ref userId);
                                                    
-                        if (result != 0)
-                        {
-                            return false;
-                        }
-
-                        if (userId != null)
-                        {
-                            return true;
-                        }
-                        else
-                        {
-                            return false;
-                        }
-                    }
-                    catch (Exception ex)
-                    {
-                        Debug.WriteLine(ex.InnerException);
-                        return false;
-                    }
-                }
+        //                if (result != 0)
+        //                {
+        //                    return false;
+        //                }
+
+        //                if (userId != null)
+        //                {
+        //                    return true;
+        //                }
+        //                else
+        //                {
+        //                    return false;
+        //                }
+        //            }
+        //            catch (Exception ex)
+        //            {
+        //                Debug.WriteLine(ex.InnerException);
+        //                return false;
+        //            }
+        //        }
            
-            }
-            return false;
-        }
-        public bool DeleteUser(Guid id)
-        {
-
-            User user = GetUser(id);
-            if (user != null)
-            {
-
-                using (UserManagementDataContext db = new UserManagementDataContext())
-                {
-                    try
-                    {
-                        Application application = GetApplication(user.ApplicationId);
-                        if (application == null)
-                        {
-                            return false;
-                        }
-
-                        int? tablesToDeleteFrom = 99;
-                        int? numTablesDeletedFrom = null;
-                        db.aspnet_Users_DeleteUser(application.ApplicationName, user.UserName, tablesToDeleteFrom, ref numTablesDeletedFrom);
+        //    }
+        //    return false;
+        //}
+        //public bool DeleteUser(Guid id)
+        //{
+
+        //    User user = GetUser(id);
+        //    if (user != null)
+        //    {
+
+        //        using (UserManagementDataContext db = new UserManagementDataContext())
+        //        {
+        //            try
+        //            {
+        //                Application application = GetApplication(user.ApplicationId);
+        //                if (application == null)
+        //                {
+        //                    return false;
+        //                }
+
+        //                int? tablesToDeleteFrom = 99;
+        //                int? numTablesDeletedFrom = null;
+        //                db.aspnet_Users_DeleteUser(application.ApplicationName, user.UserName, tablesToDeleteFrom, ref numTablesDeletedFrom);
                        
-                        if (numTablesDeletedFrom != null)
-                        {
-                            return true;
-                        }
-                        else
-                        {
-                            return false;
-                        }
-                    }
-                    catch (Exception ex)
-                    {
-                        Debug.WriteLine(ex.InnerException);
-                        return false;
-                    }
-                }
-            }
-            return false;
-        }
-
-        public bool UpdateUser(User user)
-        {
+        //                if (numTablesDeletedFrom != null)
+        //                {
+        //                    return true;
+        //                }
+        //                else
+        //                {
+        //                    return false;
+        //                }
+        //            }
+        //            catch (Exception ex)
+        //            {
+        //                Debug.WriteLine(ex.InnerException);
+        //                return false;
+        //            }
+        //        }
+        //    }
+        //    return false;
+        //}
+
+        //public bool UpdateUser(User user)
+        //{
            
-            if (user != null)
-            {
-
-                using (UserManagementDataContext db = new UserManagementDataContext())
-                {
-                    try
-                    {
-                        if (user.Membership == null)
-                        {
-                            return false;
-                        }
-
-                        Table<aspnet_User> UserTable = db.GetTable<aspnet_User>();
-
-                        var User = from item in UserTable
-                                   where item.UserId == user.UserId
-                                   select item;
-                       aspnet_User eUser = ((aspnet_User)User.Single());
-
-
-                       Table<aspnet_Membership> MembershipTable = db.GetTable<aspnet_Membership>();
-
-                       var Membership = from item in MembershipTable
-                                        where item.UserId == user.UserId
-                                        select item;
-
-                       aspnet_Membership eMembership = ((aspnet_Membership)Membership.Single());
-
-                        Convert.ToEntity(user, eUser);
+        //    if (user != null)
+        //    {
+
+        //        using (UserManagementDataContext db = new UserManagementDataContext())
+        //        {
+        //            try
+        //            {
+        //                if (user.Membership == null)
+        //                {
+        //                    return false;
+        //                }
+
+        //                Table<aspnet_User> UserTable = db.GetTable<aspnet_User>();
+
+        //                var User = from item in UserTable
+        //                           where item.UserId == user.UserId
+        //                           select item;
+        //               aspnet_User eUser = ((aspnet_User)User.Single());
+
+
+        //               Table<aspnet_Membership> MembershipTable = db.GetTable<aspnet_Membership>();
+
+        //               var Membership = from item in MembershipTable
+        //                                where item.UserId == user.UserId
+        //                                select item;
+
+        //               aspnet_Membership eMembership = ((aspnet_Membership)Membership.Single());
+
+        //                Convert.ToEntity(user, eUser);
                         
-                        Convert.ToEntity(user.Membership, eMembership);
-                        if (eUser == null)
-                        {
-                           return false;
-                        }
-                        if (eMembership == null)
-                        {
-                            return false;
-                        }
-                        db.SubmitChanges();
-                    }
-                    catch (Exception ex)
-                    {
-                        Debug.WriteLine(ex.InnerException);
-                        return false;
-                    }
-                }
-            } return false;
-        }
-
-        #endregion
-
-
-        #region Role
-
-        public Role GetRole(Guid id)
-        {
-            using (UserManagementDataContext db = new UserManagementDataContext())
-            {
-                try
-                {
-                    Table<aspnet_Role> RoleTable = db.GetTable<aspnet_Role>();
-
-                    var Role = from item in RoleTable
-                               where item.RoleId == id
-                               select item;
-                    return Convert.ToDataTransfer((aspnet_Role)Role.Single());
-                }
-                catch (Exception ex)
-                {
-                    Debug.WriteLine(ex.InnerException);
-                    return null;
-                }
-            }
-        }
-
-        public Role GetRole(Guid applicationId, string roleName)
-        {
-            using (UserManagementDataContext db = new UserManagementDataContext())
-            {
-                try
-                {
-                    Table<aspnet_Role> RoleTable = db.GetTable<aspnet_Role>();
-
-                    var Role = from item in RoleTable
-                               where item.RoleName == roleName && item.ApplicationId == applicationId
-                               select item;
-                    return Convert.ToDataTransfer((aspnet_Role)Role.Single());
-                }
-                catch (Exception ex)
-                {
-                    Debug.WriteLine(ex.InnerException);
-                    return null;
-                }
-            }
-        }
-
-        public bool RoleExists(Guid roleId)
-        {
-            if (roleId != null)
-            {
-                using (UserManagementDataContext db = new UserManagementDataContext())
-                {
-                    try
-                    {
-                        Role role = GetRole(roleId);
-                        if (role == null)
-                        {
-                            return false;
-                        }
-                        Application application = GetApplication(role.ApplicationId);
-                        if (application == null)
-                        {
-                            return false;
-                        }
-
-                        int result = db.aspnet_Roles_RoleExists(application.ApplicationName, role.RoleName);
+        //                Convert.ToEntity(user.Membership, eMembership);
+        //                if (eUser == null)
+        //                {
+        //                   return false;
+        //                }
+        //                if (eMembership == null)
+        //                {
+        //                    return false;
+        //                }
+        //                db.SubmitChanges();
+        //            }
+        //            catch (Exception ex)
+        //            {
+        //                Debug.WriteLine(ex.InnerException);
+        //                return false;
+        //            }
+        //        }
+        //    } return false;
+        //}
+
+        //#endregion
+
+        //#region Role
+
+        //public Role GetRole(Guid id)
+        //{
+        //    using (UserManagementDataContext db = new UserManagementDataContext())
+        //    {
+        //        try
+        //        {
+        //            Table<aspnet_Role> RoleTable = db.GetTable<aspnet_Role>();
+
+        //            var Role = from item in RoleTable
+        //                       where item.RoleId == id
+        //                       select item;
+        //            return Convert.ToDataTransfer((aspnet_Role)Role.Single());
+        //        }
+        //        catch (Exception ex)
+        //        {
+        //            Debug.WriteLine(ex.InnerException);
+        //            return null;
+        //        }
+        //    }
+        //}
+
+        //public Role GetRole(Guid applicationId, string roleName)
+        //{
+        //    using (UserManagementDataContext db = new UserManagementDataContext())
+        //    {
+        //        try
+        //        {
+        //            Table<aspnet_Role> RoleTable = db.GetTable<aspnet_Role>();
+
+        //            var Role = from item in RoleTable
+        //                       where item.RoleName == roleName && item.ApplicationId == applicationId
+        //                       select item;
+        //            return Convert.ToDataTransfer((aspnet_Role)Role.Single());
+        //        }
+        //        catch (Exception ex)
+        //        {
+        //            Debug.WriteLine(ex.InnerException);
+        //            return null;
+        //        }
+        //    }
+        //}
+
+        //public bool RoleExists(Guid roleId)
+        //{
+        //    if (roleId != null)
+        //    {
+        //        using (UserManagementDataContext db = new UserManagementDataContext())
+        //        {
+        //            try
+        //            {
+        //                Role role = GetRole(roleId);
+        //                if (role == null)
+        //                {
+        //                    return false;
+        //                }
+        //                Application application = GetApplication(role.ApplicationId);
+        //                if (application == null)
+        //                {
+        //                    return false;
+        //                }
+
+        //                int result = db.aspnet_Roles_RoleExists(application.ApplicationName, role.RoleName);
                         
-                        return (result == 0);
-                    }
-                    catch (Exception ex)
-                    {
-                        Debug.Write(ex.InnerException);
-                        return false;
-                    }
-                }
-
-            } return false;
-        }
-
-        public IEnumerable<Role> GetRoles(Guid applicationId)
-        {
-            List<Role> RoleList = new List<Role>();
-
-            using (UserManagementDataContext db = new UserManagementDataContext())
-            {
-                try
-                {
-                   // db.aspnet_Roles_GetAllRoles(applicationName);
-                    Table<aspnet_Role> RoleTable = db.GetTable<aspnet_Role>();
-
-                    var Roles = from item in RoleTable
-                                where item.ApplicationId == applicationId
-                                select item;
-                    foreach (var Role in Roles)
-                    {
-                        RoleList.Add(Convert.ToDataTransfer((aspnet_Role)Role));
-                    }
-                }
-                catch (Exception ex)
-                {
-                    Debug.WriteLine(ex.InnerException);
-                    return new List<Role>();
-                }
-            }
-
-            return RoleList;
-        }
+        //                return (result == 0);
+        //            }
+        //            catch (Exception ex)
+        //            {
+        //                Debug.Write(ex.InnerException);
+        //                return false;
+        //            }
+        //        }
+
+        //    } return false;
+        //}
+
+        //public IEnumerable<Role> GetRoles(Guid applicationId)
+        //{
+        //    List<Role> RoleList = new List<Role>();
+
+        //    using (UserManagementDataContext db = new UserManagementDataContext())
+        //    {
+        //        try
+        //        {
+        //           // db.aspnet_Roles_GetAllRoles(applicationName);
+        //            Table<aspnet_Role> RoleTable = db.GetTable<aspnet_Role>();
+
+        //            var Roles = from item in RoleTable
+        //                        where item.ApplicationId == applicationId
+        //                        select item;
+        //            foreach (var Role in Roles)
+        //            {
+        //                RoleList.Add(Convert.ToDataTransfer((aspnet_Role)Role));
+        //            }
+        //        }
+        //        catch (Exception ex)
+        //        {
+        //            Debug.WriteLine(ex.InnerException);
+        //            return new List<Role>();
+        //        }
+        //    }
+
+        //    return RoleList;
+        //}
         
-        public bool InsertRole(Role role)
-        {
-            if (role != null)
-            {
-                using (UserManagementDataContext db = new UserManagementDataContext())
-                {
-                    try
-                    {
-                        Application application = GetApplication(role.ApplicationId);
-                        if (application == null)
-                        {
-                            return false;
-                        }
-                        int result = db.aspnet_Roles_CreateRole(application.ApplicationName, role.RoleName);
+        //public bool InsertRole(Role role)
+        //{
+        //    if (role != null)
+        //    {
+        //        using (UserManagementDataContext db = new UserManagementDataContext())
+        //        {
+        //            try
+        //            {
+        //                Application application = GetApplication(role.ApplicationId);
+        //                if (application == null)
+        //                {
+        //                    return false;
+        //                }
+        //                int result = db.aspnet_Roles_CreateRole(application.ApplicationName, role.RoleName);
                        
-                        return (result == 0); // checken, welchen rückgabewert (in db, procedure)
+        //                return (result == 0); // checken, welchen rückgabewert (in db, procedure)
                       
-                    }
-                    catch (Exception ex)
-                    {
-                        Debug.WriteLine(ex.InnerException);
-                        return false;
-                    }
-                }
+        //            }
+        //            catch (Exception ex)
+        //            {
+        //                Debug.WriteLine(ex.InnerException);
+        //                return false;
+        //            }
+        //        }
               
-            }
-            return false;
-        }
-        public bool UpdateRole(Role role)
-        {
-
-            if (role != null)
-            {
-
-                using (UserManagementDataContext db = new UserManagementDataContext())
-                {
-                    try
-                    {
-
-                        Table<aspnet_Role> RoleTable = db.GetTable<aspnet_Role>();
-
-                        var Role = from item in RoleTable
-                                   where item.RoleId == role.RoleId
-                                   select item;
-                        aspnet_Role eRole = ((aspnet_Role)Role.Single());
-
-
-                        Convert.ToEntity(role, eRole);
-
-                        if (eRole != null)
-                        {
-                            db.SubmitChanges();
-                        }
-                        else
-                        {
-                            return false;
-                        }
-                    }
-                    catch (Exception ex)
-                    {
-                        Debug.WriteLine(ex.InnerException);
-                        return false;
-                    }
-                }
-            } return false;
-        }
-
-        public bool DeleteRole(Guid id)
-        {
-            if (id != null)
-            {
-                using (UserManagementDataContext db = new UserManagementDataContext())
-                {
-                    try
-                    {
-                        Role role = GetRole(id);
-
-                        bool deleteOnlyIfRoleIsEmpty = false;
-                        if (role == null)
-                        {
-                            return false;
-                        }
-                        Application application = GetApplication(role.ApplicationId);
-                        if (application == null)
-                        {
-                            return false;
-                        }
-                        db.aspnet_Roles_DeleteRole(application.ApplicationName, role.RoleName, deleteOnlyIfRoleIsEmpty);
+        //    }
+        //    return false;
+        //}
+        //public bool UpdateRole(Role role)
+        //{
+
+        //    if (role != null)
+        //    {
+
+        //        using (UserManagementDataContext db = new UserManagementDataContext())
+        //        {
+        //            try
+        //            {
+
+        //                Table<aspnet_Role> RoleTable = db.GetTable<aspnet_Role>();
+
+        //                var Role = from item in RoleTable
+        //                           where item.RoleId == role.RoleId
+        //                           select item;
+        //                aspnet_Role eRole = ((aspnet_Role)Role.Single());
+
+
+        //                Convert.ToEntity(role, eRole);
+
+        //                if (eRole != null)
+        //                {
+        //                    db.SubmitChanges();
+        //                }
+        //                else
+        //                {
+        //                    return false;
+        //                }
+        //            }
+        //            catch (Exception ex)
+        //            {
+        //                Debug.WriteLine(ex.InnerException);
+        //                return false;
+        //            }
+        //        }
+        //    } return false;
+        //}
+
+        //public bool DeleteRole(Guid id)
+        //{
+        //    if (id != null)
+        //    {
+        //        using (UserManagementDataContext db = new UserManagementDataContext())
+        //        {
+        //            try
+        //            {
+        //                Role role = GetRole(id);
+
+        //                bool deleteOnlyIfRoleIsEmpty = false;
+        //                if (role == null)
+        //                {
+        //                    return false;
+        //                }
+        //                Application application = GetApplication(role.ApplicationId);
+        //                if (application == null)
+        //                {
+        //                    return false;
+        //                }
+        //                db.aspnet_Roles_DeleteRole(application.ApplicationName, role.RoleName, deleteOnlyIfRoleIsEmpty);
 
                       
 
-                        return true;
-                    }
-                    catch (Exception ex)
-                    {
-                        Debug.WriteLine(ex.InnerException);
-                        return false;
-                    }
-                }
+        //                return true;
+        //            }
+        //            catch (Exception ex)
+        //            {
+        //                Debug.WriteLine(ex.InnerException);
+        //                return false;
+        //            }
+        //        }
               
-            }
-            return false;
-        }
-
-        public bool IsUserInRole(Guid roleId, Guid userId)
-        {
-            if (roleId != null && userId != null)
-            {
-                using (UserManagementDataContext db = new UserManagementDataContext())
-                {
-
-                    try
-                    {
-                        User user = GetUser(userId);
-                        if (user == null) { return false; }
-
-                        Application application = GetApplication(user.ApplicationId);
-                        if (application == null) { return false; }
-
-                        Role role = GetRole(roleId);
-                        if (role == null) { return false; }
-
-                        int result = db.aspnet_UsersInRoles_IsUserInRole(application.ApplicationName, user.UserName, role.RoleName);
+        //    }
+        //    return false;
+        //}
+
+        //public bool IsUserInRole(Guid roleId, Guid userId)
+        //{
+        //    if (roleId != null && userId != null)
+        //    {
+        //        using (UserManagementDataContext db = new UserManagementDataContext())
+        //        {
+
+        //            try
+        //            {
+        //                User user = GetUser(userId);
+        //                if (user == null) { return false; }
+
+        //                Application application = GetApplication(user.ApplicationId);
+        //                if (application == null) { return false; }
+
+        //                Role role = GetRole(roleId);
+        //                if (role == null) { return false; }
+
+        //                int result = db.aspnet_UsersInRoles_IsUserInRole(application.ApplicationName, user.UserName, role.RoleName);
                        
-                        return (result == 0);
-                    }
-                    catch (Exception ex)
-                    {
-                        Debug.WriteLine(ex.InnerException);
-                        return false;
-
-                    }
-
-                }
-
-            } return false;
-        }
-
-        public bool AddUserToRole(Guid roleId, Guid userId)
-        {
-            using (UserManagementDataContext db = new UserManagementDataContext())
-            {
-                try
-                {
-                    Role role = GetRole(roleId);
-                    if (role == null)
-                    {
-                        return false;
-                    }
-                    Application application = GetApplication(role.ApplicationId);
-                    if (application == null)
-                    {
-                        return false;
-                    }
-                    User user = GetUser(userId);
-                    if (user == null)
-                    {
-                        return false;
-                    }
-
-                    db.aspnet_UsersInRoles_AddUsersToRoles(application.ApplicationName, user.UserName, role.RoleName,DateTime.Now);
-                    return true;
-                }
-                catch (Exception ex)
-                {
-                    Debug.WriteLine(ex.InnerException);
-                    return false;
-                }
-            }
+        //                return (result == 0);
+        //            }
+        //            catch (Exception ex)
+        //            {
+        //                Debug.WriteLine(ex.InnerException);
+        //                return false;
+
+        //            }
+
+        //        }
+
+        //    } return false;
+        //}
+
+        //public bool AddUserToRole(Guid roleId, Guid userId)
+        //{
+        //    using (UserManagementDataContext db = new UserManagementDataContext())
+        //    {
+        //        try
+        //        {
+        //            Role role = GetRole(roleId);
+        //            if (role == null)
+        //            {
+        //                return false;
+        //            }
+        //            Application application = GetApplication(role.ApplicationId);
+        //            if (application == null)
+        //            {
+        //                return false;
+        //            }
+        //            User user = GetUser(userId);
+        //            if (user == null)
+        //            {
+        //                return false;
+        //            }
+
+        //            db.aspnet_UsersInRoles_AddUsersToRoles(application.ApplicationName, user.UserName, role.RoleName,DateTime.Now);
+        //            return true;
+        //        }
+        //        catch (Exception ex)
+        //        {
+        //            Debug.WriteLine(ex.InnerException);
+        //            return false;
+        //        }
+        //    }
         
-        }
-        public bool RemoveUserFromRole(Guid roleId, Guid userId)
-        {
-            using (UserManagementDataContext db = new UserManagementDataContext())
-            {
-                try
-                {
-                    Role role = GetRole(roleId);
-                    if (role == null)
-                    {
-                        return false;
-                    }
-                    Application application = GetApplication(role.ApplicationId);
-                    if (application == null)
-                    {
-                        return false;
-                    }
-                    User user = GetUser(userId);
-                    if (user == null)
-                    {
-                        return false;
-                    }
-
-                   db.aspnet_UsersInRoles_RemoveUsersFromRoles(application.ApplicationName, user.UserName, role.RoleName);
-                    return true;
+        //}
+        //public bool RemoveUserFromRole(Guid roleId, Guid userId)
+        //{
+        //    using (UserManagementDataContext db = new UserManagementDataContext())
+        //    {
+        //        try
+        //        {
+        //            Role role = GetRole(roleId);
+        //            if (role == null)
+        //            {
+        //                return false;
+        //            }
+        //            Application application = GetApplication(role.ApplicationId);
+        //            if (application == null)
+        //            {
+        //                return false;
+        //            }
+        //            User user = GetUser(userId);
+        //            if (user == null)
+        //            {
+        //                return false;
+        //            }
+
+        //           db.aspnet_UsersInRoles_RemoveUsersFromRoles(application.ApplicationName, user.UserName, role.RoleName);
+        //            return true;
                    
-                }
-                catch (Exception ex)
-                {
-                    Debug.WriteLine(ex.InnerException);
-                    return false;
-                }
-            }
+        //        }
+        //        catch (Exception ex)
+        //        {
+        //            Debug.WriteLine(ex.InnerException);
+        //            return false;
+        //        }
+        //    }
            
-        }
-        public IEnumerable<Role> GetRolesForUser(Guid userId)
-        {
-            List<Role> roles = new List<Role>();
-            using (UserManagementDataContext db = new UserManagementDataContext())
-            {
-                try
-                {
-                    User user = GetUser(userId);
-                    if (user == null)
-                    {
-                        return roles;
-                    }
-                    Application application = GetApplication(user.ApplicationId);
-                    if (application == null)
-                    {
-                        return roles;
-                    }
+        //}
+        //public IEnumerable<Role> GetRolesForUser(Guid userId)
+        //{
+        //    List<Role> roles = new List<Role>();
+        //    using (UserManagementDataContext db = new UserManagementDataContext())
+        //    {
+        //        try
+        //        {
+        //            User user = GetUser(userId);
+        //            if (user == null)
+        //            {
+        //                return roles;
+        //            }
+        //            Application application = GetApplication(user.ApplicationId);
+        //            if (application == null)
+        //            {
+        //                return roles;
+        //            }
                     
 
-                    ISingleResult<aspnet_UsersInRoles_GetRolesForUserResult> results = db.aspnet_UsersInRoles_GetRolesForUser(application.ApplicationName,user.UserName);
-                    foreach (aspnet_UsersInRoles_GetRolesForUserResult userInRole in results)
-                    {
-                        roles.Add(GetRole(application.ApplicationId,userInRole.RoleName));
-                    }
-                }
-                catch (Exception ex)
-                {
-                    Debug.WriteLine(ex.InnerException);
-                    return new List<Role>();
-                }
-            }
+        //            ISingleResult<aspnet_UsersInRoles_GetRolesForUserResult> results = db.aspnet_UsersInRoles_GetRolesForUser(application.ApplicationName,user.UserName);
+        //            foreach (aspnet_UsersInRoles_GetRolesForUserResult userInRole in results)
+        //            {
+        //                roles.Add(GetRole(application.ApplicationId,userInRole.RoleName));
+        //            }
+        //        }
+        //        catch (Exception ex)
+        //        {
+        //            Debug.WriteLine(ex.InnerException);
+        //            return new List<Role>();
+        //        }
+        //    }
             
-            return roles;
-        }
-
-        public IEnumerable<User> GetUsersInRole(Guid roleId)
-        {
-            List<User> users = new List<User>();
-
-            using(UserManagementDataContext db = new UserManagementDataContext()){
-                try
-                {
-                    Role role = GetRole(roleId);
-
-                    if (role != null)
-                    {
-                        Application application = GetApplication(role.ApplicationId);
-
-                        if (application != null)
-                        {
-
-
-                            ISingleResult<aspnet_UsersInRoles_GetUsersInRolesResult> result = db.aspnet_UsersInRoles_GetUsersInRoles(application.ApplicationName, role.RoleName);
-                            foreach (aspnet_UsersInRoles_GetUsersInRolesResult usersInRole in result)
-                            {
-                                users.Add(GetUser(application.ApplicationId,usersInRole.UserName));
-                            }
-                        }
-                    }
-                }
-                catch (Exception ex)
-                {
-                    Debug.WriteLine(ex.InnerException);
-                    return new List<User>();
-                }
-            }
-
-            return users;
-        }
-
-        #endregion
-
-        #region Application
-
-        public Application InsertApplication(Application application)
-        {
-            if (application != null)
-            {
-                using (UserManagementDataContext db = new UserManagementDataContext())
-                {
-                    try
-                    {
-                        Guid? applicationId = null;
-                        int result = db.aspnet_Applications_CreateApplication(application.ApplicationName, ref applicationId);
-                        Console.WriteLine("result=" + result);
-                        if (applicationId != null)
-                        {
-                            application.ApplicationId = (Guid)applicationId;
-                            return application;
-                        }
-                        else
-                        {
-                            return null;
-                        }
-                    }
-                    catch (Exception ex)
-                    {
-                        Debug.WriteLine(ex.InnerException);
-                        return null;
-                    }
-                }
+        //    return roles;
+        //}
+
+        //public IEnumerable<User> GetUsersInRole(Guid roleId)
+        //{
+        //    List<User> users = new List<User>();
+
+        //    using(UserManagementDataContext db = new UserManagementDataContext()){
+        //        try
+        //        {
+        //            Role role = GetRole(roleId);
+
+        //            if (role != null)
+        //            {
+        //                Application application = GetApplication(role.ApplicationId);
+
+        //                if (application != null)
+        //                {
+
+
+        //                    ISingleResult<aspnet_UsersInRoles_GetUsersInRolesResult> result = db.aspnet_UsersInRoles_GetUsersInRoles(application.ApplicationName, role.RoleName);
+        //                    foreach (aspnet_UsersInRoles_GetUsersInRolesResult usersInRole in result)
+        //                    {
+        //                        users.Add(GetUser(application.ApplicationId,usersInRole.UserName));
+        //                    }
+        //                }
+        //            }
+        //        }
+        //        catch (Exception ex)
+        //        {
+        //            Debug.WriteLine(ex.InnerException);
+        //            return new List<User>();
+        //        }
+        //    }
+
+        //    return users;
+        //}
+
+        //#endregion
+
+        //#region Application
+
+        //public Application InsertApplication(Application application)
+        //{
+        //    if (application != null)
+        //    {
+        //        using (UserManagementDataContext db = new UserManagementDataContext())
+        //        {
+        //            try
+        //            {
+        //                Guid? applicationId = null;
+        //                int result = db.aspnet_Applications_CreateApplication(application.ApplicationName, ref applicationId);
+        //                Console.WriteLine("result=" + result);
+        //                if (applicationId != null)
+        //                {
+        //                    application.ApplicationId = (Guid)applicationId;
+        //                    return application;
+        //                }
+        //                else
+        //                {
+        //                    return null;
+        //                }
+        //            }
+        //            catch (Exception ex)
+        //            {
+        //                Debug.WriteLine(ex.InnerException);
+        //                return null;
+        //            }
+        //        }
               
-            }
-            return null;
-        }
-
-        public bool DeleteApplication(Application application)
-        {
-            return false;
-        }
-
-        public Application GetApplication(Guid id)
-        {
-            using (UserManagementDataContext db = new UserManagementDataContext())
-            {
-                try
-                {
-                    Table<aspnet_Application> ApplicationTable = db.GetTable<aspnet_Application>();
-
-                    var Application = from item in ApplicationTable
-                                      where item.ApplicationId == id
-                                      select item;
-                    return Convert.ToDataTransfer((aspnet_Application)Application.Single());
-                }
-                catch (Exception ex)
-                {
-                    Debug.WriteLine(ex.InnerException);
-                    return null;
-                }
-            }
-        }
-
-        public IEnumerable<DataTransfer.Application> GetApplications()
-        {
-            List<DataTransfer.Application> ApplicationList = new List<DataTransfer.Application>();
-            using (UserManagementDataContext db = new UserManagementDataContext())
-            {
-                try
-                {
-                    Table<aspnet_Application> ApplicationTable = db.GetTable<aspnet_Application>();
-                    var Applications = from item in ApplicationTable
-                                select item;
-                    foreach (var eApplication in Applications)
-                    {
-
-                        Application application = Convert.ToDataTransfer(eApplication);
-
-                        if (application == null) { return null; }
-
-
-                        ApplicationList.Add(application);
-                    }
-                }
-                catch (Exception ex)
-                {
-                    Debug.WriteLine(ex.InnerException);
-                    return new List<Application>();
-                }
-            }
-
-            return ApplicationList;
-        }
-
-
-
-        #endregion
-
-        #region Membership
-
-        public Membership InsertMembership(Membership membership)
-        {
-
-            if (membership != null)
-            {
-                using (UserManagementDataContext db = new UserManagementDataContext())
-                {
-                    try
-                    {
-                        Application application = GetApplication(membership.ApplicationId);
-                        if (application == null) { return null; }
-
-                    }
-                    catch (Exception ex)
-                    {
-                        Debug.WriteLine(ex.InnerException);
-                        return null;
-                    }
-                }
-            }
-            return null;
-        }
-
-        #endregion
+        //    }
+        //    return null;
+        //}
+
+        //public bool DeleteApplication(Application application)
+        //{
+        //    return false;
+        //}
+
+        //public Application GetApplication(Guid id)
+        //{
+        //    using (UserManagementDataContext db = new UserManagementDataContext())
+        //    {
+        //        try
+        //        {
+        //            Table<aspnet_Application> ApplicationTable = db.GetTable<aspnet_Application>();
+
+        //            var Application = from item in ApplicationTable
+        //                              where item.ApplicationId == id
+        //                              select item;
+        //            return Convert.ToDataTransfer((aspnet_Application)Application.Single());
+        //        }
+        //        catch (Exception ex)
+        //        {
+        //            Debug.WriteLine(ex.InnerException);
+        //            return null;
+        //        }
+        //    }
+        //}
+
+        //public IEnumerable<DataTransfer.Application> GetApplications()
+        //{
+        //    List<DataTransfer.Application> ApplicationList = new List<DataTransfer.Application>();
+        //    using (UserManagementDataContext db = new UserManagementDataContext())
+        //    {
+        //        try
+        //        {
+        //            Table<aspnet_Application> ApplicationTable = db.GetTable<aspnet_Application>();
+        //            var Applications = from item in ApplicationTable
+        //                        select item;
+        //            foreach (var eApplication in Applications)
+        //            {
+
+        //                Application application = Convert.ToDataTransfer(eApplication);
+
+        //                if (application == null) { return null; }
+
+
+        //                ApplicationList.Add(application);
+        //            }
+        //        }
+        //        catch (Exception ex)
+        //        {
+        //            Debug.WriteLine(ex.InnerException);
+        //            return new List<Application>();
+        //        }
+        //    }
+
+        //    return ApplicationList;
+        //}
+
+
+
+        //#endregion
+
+        //#region Membership
+
+        //public Membership InsertMembership(Membership membership)
+        //{
+
+        //    if (membership != null)
+        //    {
+        //        using (UserManagementDataContext db = new UserManagementDataContext())
+        //        {
+        //            try
+        //            {
+        //                Application application = GetApplication(membership.ApplicationId);
+        //                if (application == null) { return null; }
+
+        //            }
+        //            catch (Exception ex)
+        //            {
+        //                Debug.WriteLine(ex.InnerException);
+        //                return null;
+        //            }
+        //        }
+        //    }
+        //    return null;
+        //}
+
+        //#endregion
     }
 }
Index: /branches/UserManagement/HeuristicLab.Services.Authentication/Convert.cs
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication/Convert.cs	(revision 4739)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication/Convert.cs	(revision 4740)
@@ -20,11 +20,39 @@
             {
                 ApplicationId = source.ApplicationId,
-                UserId = source.UserId,
-                UserName = source.UserName,
-                LoweredUserName = source.LoweredUserName,
-                IsAnonymous = source.IsAnonymous,
+                UserId = source.Id,
+                UserName = source.Name,
+                //LoweredUserName = source.LoweredUserName,
+                //IsAnonymous = source.IsAnonymous,
                 LastActivityDate = source.LastActivityDate
             };
         }
+
+        ///// <summary>
+        ///// converts data transfer object to data access objet
+        ///// </summary>
+        ///// <param name="source">data transfer object</param>
+        ///// <returns>data access object</returns>
+        //public static aspnet_Membership ToEntity(User source) {
+        //  if (source == null) return null;
+        //  return new aspnet_Membership() {
+        //    ApplicationId = source.ApplicationId,
+        //    UserId = source.Id,
+        //    Password = source.Password,
+        //    PasswordFormat = 1,
+        //    PasswordSalt = source.PasswordSalt,
+        //    Email = source.Email,
+        //    IsApproved = source.IsApproved,
+        //    IsLockedOut = source.IsLookedOut,
+        //    CreateDate = source.CreateDate,
+        //    LastLoginDate = source.LastLoginDate,
+        //    LastPasswordChangedDate = source.LastPasswordChangeDate,
+        //    LastLockoutDate = source.LastLockoutDate,
+        //    FailedPasswordAttemptCount = 0,
+        //    FailedPasswordAttemptWindowStart = new System.DateTime(1900, 01, 01),
+        //    FailedPasswordAnswerAttemptCount = 0,
+        //    FailedPasswordAnswerAttemptWindowStart = new System.DateTime(1900, 01, 01),
+        //    Comment = source.Comment
+        //  };
+        //}
 
         /// <summary>
@@ -33,15 +61,25 @@
         /// <param name="source">data access object</param>
         /// <returns>data transfer object</returns>
-        public static User ToDataTransfer(aspnet_User source)
+        public static User ToDataTransfer(aspnet_User userSource, aspnet_Membership membershipSource)
         {
-            if (source == null) return null;
+            if (userSource == null || membershipSource == null) return null;
             return new User()
             {
-                ApplicationId = source.ApplicationId,
-                UserId = source.UserId,
-                UserName = source.UserName,
-                LoweredUserName = source.LoweredUserName,
-                IsAnonymous = source.IsAnonymous,
-                LastActivityDate = source.LastActivityDate
+                ApplicationId = userSource.ApplicationId,
+                Id = userSource.UserId,
+                Name = userSource.UserName,
+                //LoweredUserName = userSource.LoweredUserName,
+                //IsAnonymous = userSource.IsAnonymous,
+                LastActivityDate = userSource.LastActivityDate,
+                Password = membershipSource.Password,
+                PasswordSalt = membershipSource.PasswordSalt,
+                Email = membershipSource.Email,
+                IsApproved = membershipSource.IsApproved,
+                IsLookedOut = membershipSource.IsApproved,
+                CreateDate = membershipSource.CreateDate,
+                LastLoginDate = membershipSource.LastLoginDate,
+                LastPasswordChangeDate = membershipSource.LastPasswordChangedDate,
+                LastLockoutDate = membershipSource.LastLockoutDate,
+                Comment = membershipSource.Comment
             };
         }
@@ -52,14 +90,32 @@
         /// <param name="source">data transfer object</param>
         /// <param name="target">data access object</param>
-        public static void ToEntity(User source, aspnet_User target)
+        public static void ToEntity(User source, aspnet_User userTarget, aspnet_Membership membershipTarget)
         {
-            if ((source != null) && (target != null))
+            if ((source != null) && (userTarget != null) && (membershipTarget != null))
             {
-                target.ApplicationId = source.ApplicationId;
-                target.UserId = source.UserId;
-                target.UserName = source.UserName;
-                target.LoweredUserName = source.LoweredUserName;
-                target.IsAnonymous = source.IsAnonymous;
-                target.LastActivityDate = source.LastActivityDate;
+              userTarget.ApplicationId = source.ApplicationId;
+              membershipTarget.ApplicationId = source.ApplicationId;
+              userTarget.UserId = source.Id;
+              membershipTarget.UserId = source.Id;
+              userTarget.UserName = source.Name;
+              userTarget.LoweredUserName = source.Name;
+              userTarget.IsAnonymous = false;
+              userTarget.LastActivityDate = source.LastActivityDate;
+              membershipTarget.Password = source.Password;
+              membershipTarget.PasswordFormat = 1;
+              membershipTarget.PasswordSalt = source.PasswordSalt;
+              membershipTarget.Email = source.Email;
+              membershipTarget.IsApproved = source.IsApproved;
+              membershipTarget.IsLockedOut = source.IsLookedOut;
+              membershipTarget.CreateDate = source.CreateDate;
+              membershipTarget.LastLoginDate = source.LastLoginDate;
+              membershipTarget.LastPasswordChangedDate = source.LastPasswordChangeDate;
+              membershipTarget.LastLockoutDate = source.LastLockoutDate;
+              membershipTarget.FailedPasswordAttemptCount = 0;
+              membershipTarget.FailedPasswordAttemptWindowStart = new System.DateTime(1900, 01, 01);
+              membershipTarget.FailedPasswordAnswerAttemptCount = 0;
+              membershipTarget.FailedPasswordAnswerAttemptWindowStart = new System.DateTime(1900, 01, 01);
+              membershipTarget.Comment = source.Comment;
+
             }
 
@@ -71,54 +127,54 @@
         #region Application
 
-        /// <summary>
-        /// converts data transfer object to data access objet
-        /// </summary>
-        /// <param name="source">data transfer object</param>
-        /// <returns>data access object</returns>
-        public static aspnet_Application ToEntity(Application source)
-        {
-            if (source == null) return null;
-            return new aspnet_Application()
-            {
-                ApplicationId = source.ApplicationId,
-                ApplicationName = source.ApplicationName,
-                LoweredApplicationName = source.LoweredApplicationName,
-                Description = source.Description
-            };
-        }
-
-        /// <summary>
-        /// converts data access object to data transfer object
-        /// </summary>
-        /// <param name="source">data access object</param>
-        /// <returns>data transfer object</returns>
-        public static Application ToDataTransfer(aspnet_Application source)
-        {
-            if (source == null) return null;
-            return new Application()
-            {
-                ApplicationId = source.ApplicationId,
-                ApplicationName = source.ApplicationName,
-                LoweredApplicationName = source.LoweredApplicationName,
-                Description = source.Description
-            };
-        }
-
-        /// <summary>
-        /// converts data transfer object to data access object
-        /// </summary>
-        /// <param name="source">data transfer object</param>
-        /// <param name="target">data access object</param>
-        public static void ToEntity(Application source, aspnet_Application target)
-        {
-            if ((source != null) && (target != null))
-            {
-                target.ApplicationId = source.ApplicationId;
-                target.ApplicationName = source.ApplicationName;
-                target.LoweredApplicationName = source.LoweredApplicationName;
-                target.Description = source.Description;
-            }
-
-        }
+        ///// <summary>
+        ///// converts data transfer object to data access objet
+        ///// </summary>
+        ///// <param name="source">data transfer object</param>
+        ///// <returns>data access object</returns>
+        //public static aspnet_Application ToEntity(Application source)
+        //{
+        //    if (source == null) return null;
+        //    return new aspnet_Application()
+        //    {
+        //        ApplicationId = source.ApplicationId,
+        //        ApplicationName = source.ApplicationName,
+        //        LoweredApplicationName = source.LoweredApplicationName,
+        //        Description = source.Description
+        //    };
+        //}
+
+        ///// <summary>
+        ///// converts data access object to data transfer object
+        ///// </summary>
+        ///// <param name="source">data access object</param>
+        ///// <returns>data transfer object</returns>
+        //public static Application ToDataTransfer(aspnet_Application source)
+        //{
+        //    if (source == null) return null;
+        //    return new Application()
+        //    {
+        //        ApplicationId = source.ApplicationId,
+        //        ApplicationName = source.ApplicationName,
+        //        LoweredApplicationName = source.LoweredApplicationName,
+        //        Description = source.Description
+        //    };
+        //}
+
+        ///// <summary>
+        ///// converts data transfer object to data access object
+        ///// </summary>
+        ///// <param name="source">data transfer object</param>
+        ///// <param name="target">data access object</param>
+        //public static void ToEntity(Application source, aspnet_Application target)
+        //{
+        //    if ((source != null) && (target != null))
+        //    {
+        //        target.ApplicationId = source.ApplicationId;
+        //        target.ApplicationName = source.ApplicationName;
+        //        target.LoweredApplicationName = source.LoweredApplicationName;
+        //        target.Description = source.Description;
+        //    }
+
+        //}
 
         #endregion
@@ -126,92 +182,92 @@
         #region Membership
 
-        /// <summary>
-        /// converts data transfer object to data access objet
-        /// </summary>
-        /// <param name="source">data transfer object</param>
-        /// <returns>data access object</returns>
-        public static aspnet_Membership ToEntity(Membership source)
-        {
-            if (source == null) return null;
-            return new aspnet_Membership()
-            {
-                ApplicationId = source.ApplicationId,
-                UserId = source.UserId,
-                Password = source.Password,
-                PasswordAnswer = source.PasswordAnswer,
-                PasswordSalt = source.PasswordSalt,
-                PasswordQuestion = source.PasswordQuestion,
+        ///// <summary>
+        ///// converts data transfer object to data access objet
+        ///// </summary>
+        ///// <param name="source">data transfer object</param>
+        ///// <returns>data access object</returns>
+        //public static aspnet_Membership ToEntity(Membership source)
+        //{
+        //    if (source == null) return null;
+        //    return new aspnet_Membership()
+        //    {
+        //        ApplicationId = source.ApplicationId,
+        //        UserId = source.UserId,
+        //        Password = source.Password,
+        //        PasswordAnswer = source.PasswordAnswer,
+        //        PasswordSalt = source.PasswordSalt,
+        //        PasswordQuestion = source.PasswordQuestion,
                
-                Email = source.Email,
-                LoweredEmail = source.LoweredEmail,
-                IsApproved = source.IsApproved,
-                IsLockedOut = source.IsLockedOut,
-                CreateDate = source.CreateDate,
-                LastLoginDate = source.LastLoginDate,
-                LastPasswordChangedDate = source.LastPasswordChangedDate,
-                LastLockoutDate = source.LastLockoutDate,
-                Comment = source.Comment
+        //        Email = source.Email,
+        //        LoweredEmail = source.LoweredEmail,
+        //        IsApproved = source.IsApproved,
+        //        IsLockedOut = source.IsLockedOut,
+        //        CreateDate = source.CreateDate,
+        //        LastLoginDate = source.LastLoginDate,
+        //        LastPasswordChangedDate = source.LastPasswordChangedDate,
+        //        LastLockoutDate = source.LastLockoutDate,
+        //        Comment = source.Comment
 
                 
-            };
-        }
-
-        /// <summary>
-        /// converts data access object to data transfer object
-        /// </summary>
-        /// <param name="source">data access object</param>
-        /// <returns>data transfer object</returns>
-        public static Membership ToDataTransfer(aspnet_Membership source)
-        {
-            if (source == null) return null;
-            return new Membership()
-            {
-                ApplicationId = source.ApplicationId,
-                UserId = source.UserId,
-                Password = source.Password,
-                PasswordAnswer = source.PasswordAnswer,
-                PasswordSalt = source.PasswordSalt,
-                PasswordQuestion = source.PasswordQuestion,
+        //    };
+        //}
+
+        ///// <summary>
+        ///// converts data access object to data transfer object
+        ///// </summary>
+        ///// <param name="source">data access object</param>
+        ///// <returns>data transfer object</returns>
+        //public static Membership ToDataTransfer(aspnet_Membership source)
+        //{
+        //    if (source == null) return null;
+        //    return new Membership()
+        //    {
+        //        ApplicationId = source.ApplicationId,
+        //        UserId = source.UserId,
+        //        Password = source.Password,
+        //        PasswordAnswer = source.PasswordAnswer,
+        //        PasswordSalt = source.PasswordSalt,
+        //        PasswordQuestion = source.PasswordQuestion,
                
-                Email = source.Email,
-                LoweredEmail = source.LoweredEmail,
-                IsApproved = source.IsApproved,
-                IsLockedOut = source.IsLockedOut,
-                CreateDate = source.CreateDate,
-                LastLoginDate = source.LastLoginDate,
-                LastPasswordChangedDate = source.LastPasswordChangedDate,
-                LastLockoutDate = source.LastLockoutDate,
-                Comment = source.Comment
-            };
-        }
-
-        /// <summary>
-        /// converts data transfer object to data access object
-        /// </summary>
-        /// <param name="source">data transfer object</param>
-        /// <param name="target">data access object</param>
-        public static void ToEntity(Membership source, aspnet_Membership target)
-        {
-            if ((source != null) && (target != null))
-            {
-                target.ApplicationId = source.ApplicationId;
-                target.UserId = source.UserId;
-                target.Password = source.Password;
-                target.PasswordAnswer = source.PasswordAnswer;
-                target.PasswordSalt = source.PasswordSalt;
-                target.PasswordQuestion = source.PasswordQuestion;
+        //        Email = source.Email,
+        //        LoweredEmail = source.LoweredEmail,
+        //        IsApproved = source.IsApproved,
+        //        IsLockedOut = source.IsLockedOut,
+        //        CreateDate = source.CreateDate,
+        //        LastLoginDate = source.LastLoginDate,
+        //        LastPasswordChangedDate = source.LastPasswordChangedDate,
+        //        LastLockoutDate = source.LastLockoutDate,
+        //        Comment = source.Comment
+        //    };
+        //}
+
+        ///// <summary>
+        ///// converts data transfer object to data access object
+        ///// </summary>
+        ///// <param name="source">data transfer object</param>
+        ///// <param name="target">data access object</param>
+        //public static void ToEntity(Membership source, aspnet_Membership target)
+        //{
+        //    if ((source != null) && (target != null))
+        //    {
+        //        target.ApplicationId = source.ApplicationId;
+        //        target.UserId = source.UserId;
+        //        target.Password = source.Password;
+        //        target.PasswordAnswer = source.PasswordAnswer;
+        //        target.PasswordSalt = source.PasswordSalt;
+        //        target.PasswordQuestion = source.PasswordQuestion;
                
-                target.Email = source.Email;
-                target.LoweredEmail = source.LoweredEmail;
-                target.IsApproved = source.IsApproved;
-                target.IsLockedOut = source.IsLockedOut;
-                target.CreateDate = source.CreateDate;
-                target.LastLoginDate = source.LastLoginDate;
-                target.LastPasswordChangedDate = source.LastPasswordChangedDate;
-                target.LastLockoutDate = source.LastLockoutDate;
-                target.Comment = source.Comment;
-            }
-
-        }
+        //        target.Email = source.Email;
+        //        target.LoweredEmail = source.LoweredEmail;
+        //        target.IsApproved = source.IsApproved;
+        //        target.IsLockedOut = source.IsLockedOut;
+        //        target.CreateDate = source.CreateDate;
+        //        target.LastLoginDate = source.LastLoginDate;
+        //        target.LastPasswordChangedDate = source.LastPasswordChangedDate;
+        //        target.LastLockoutDate = source.LastLockoutDate;
+        //        target.Comment = source.Comment;
+        //    }
+
+        //}
 
         #endregion
@@ -219,57 +275,57 @@
         #region Role
 
-        /// <summary>
-        /// converts data transfer object to data access objet
-        /// </summary>
-        /// <param name="source">data transfer object</param>
-        /// <returns>data access object</returns>
-        public static aspnet_Role ToEntity(Role source)
-        {
-            if (source == null) return null;
-            return new aspnet_Role()
-            {
-                ApplicationId = source.ApplicationId,
-                RoleId = source.RoleId,
-                RoleName = source.RoleName,
-                LoweredRoleName = source.LoweredRoleName,
-                Description = source.Description
-            };
-        }
-
-        /// <summary>
-        /// converts data access object to data transfer object
-        /// </summary>
-        /// <param name="source">data access object</param>
-        /// <returns>data transfer object</returns>
-        public static Role ToDataTransfer(aspnet_Role source)
-        {
-            if (source == null) return null;
-            return new Role()
-            {
-                ApplicationId = source.ApplicationId,
-                RoleId = source.RoleId,
-                RoleName = source.RoleName,
-                LoweredRoleName = source.LoweredRoleName,
-                Description = source.Description
-            };
-        }
-
-        /// <summary>
-        /// converts data transfer object to data access object
-        /// </summary>
-        /// <param name="source">data transfer object</param>
-        /// <param name="target">data access object</param>
-        public static void ToEntity(Role source, aspnet_Role target)
-        {
-            if ((source != null) && (target != null))
-            {
-                target.ApplicationId = source.ApplicationId;
-                target.RoleId = source.RoleId;
-                target.RoleName = source.RoleName;
-                target.LoweredRoleName = source.LoweredRoleName;
-                target.Description = source.Description;
-            }
-
-        }
+        ///// <summary>
+        ///// converts data transfer object to data access objet
+        ///// </summary>
+        ///// <param name="source">data transfer object</param>
+        ///// <returns>data access object</returns>
+        //public static aspnet_Role ToEntity(Role source)
+        //{
+        //    if (source == null) return null;
+        //    return new aspnet_Role()
+        //    {
+        //        ApplicationId = source.ApplicationId,
+        //        RoleId = source.RoleId,
+        //        RoleName = source.RoleName,
+        //        LoweredRoleName = source.LoweredRoleName,
+        //        Description = source.Description
+        //    };
+        //}
+
+        ///// <summary>
+        ///// converts data access object to data transfer object
+        ///// </summary>
+        ///// <param name="source">data access object</param>
+        ///// <returns>data transfer object</returns>
+        //public static Role ToDataTransfer(aspnet_Role source)
+        //{
+        //    if (source == null) return null;
+        //    return new Role()
+        //    {
+        //        ApplicationId = source.ApplicationId,
+        //        RoleId = source.RoleId,
+        //        RoleName = source.RoleName,
+        //        LoweredRoleName = source.LoweredRoleName,
+        //        Description = source.Description
+        //    };
+        //}
+
+        ///// <summary>
+        ///// converts data transfer object to data access object
+        ///// </summary>
+        ///// <param name="source">data transfer object</param>
+        ///// <param name="target">data access object</param>
+        //public static void ToEntity(Role source, aspnet_Role target)
+        //{
+        //    if ((source != null) && (target != null))
+        //    {
+        //        target.ApplicationId = source.ApplicationId;
+        //        target.RoleId = source.RoleId;
+        //        target.RoleName = source.RoleName;
+        //        target.LoweredRoleName = source.LoweredRoleName;
+        //        target.Description = source.Description;
+        //    }
+
+        //}
 
         #endregion
Index: /branches/UserManagement/HeuristicLab.Services.Authentication/Interfaces/IAuthenticationService.cs
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication/Interfaces/IAuthenticationService.cs	(revision 4739)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication/Interfaces/IAuthenticationService.cs	(revision 4740)
@@ -15,27 +15,27 @@
         User GetUser(Guid id);
 
-        [OperationContract]
-        User GetUser(Guid applicationId, string userName);
+        //[OperationContract]
+        //User GetUser(Guid applicationId, string userName);
 
-        [OperationContract]
-        IEnumerable<User> GetUsers(Guid applicationId);
+        //[OperationContract]
+        //IEnumerable<User> GetUsers(Guid applicationId);
 
-        [OperationContract]
-        bool InsertUser(User user);
+        //[OperationContract]
+        //bool InsertUser(User user);
 
-        [OperationContract]
-        bool DeleteUser(Guid id);
+        //[OperationContract]
+        //bool DeleteUser(Guid id);
 
-        [OperationContract]
-        bool UpdateUser(User user);
+        //[OperationContract]
+        //bool UpdateUser(User user);
 
-        [OperationContract]
-        bool AddUserToRole(Guid roleId, Guid userId);
+        //[OperationContract]
+        //bool AddUserToRole(Guid roleId, Guid userId);
 
-        [OperationContract]
-        bool RemoveUserFromRole(Guid roleId, Guid userId);
+        //[OperationContract]
+        //bool RemoveUserFromRole(Guid roleId, Guid userId);
 
-        [OperationContract]
-        IEnumerable<Role> GetRolesForUser(Guid userId);
+        //[OperationContract]
+        //IEnumerable<Role> GetRolesForUser(Guid userId);
 
         #endregion
@@ -43,30 +43,30 @@
         #region Role
 
-        [OperationContract]
-        Role GetRole(Guid id);
+        //[OperationContract]
+        //Role GetRole(Guid id);
         
-        [OperationContract]
-        Role GetRole(Guid applicationId, string roleName);
+        //[OperationContract]
+        //Role GetRole(Guid applicationId, string roleName);
 
-        [OperationContract]
-        IEnumerable<Role> GetRoles(Guid applicationId);
+        //[OperationContract]
+        //IEnumerable<Role> GetRoles(Guid applicationId);
 
-        [OperationContract]
-        bool RoleExists(Guid roleId);
+        //[OperationContract]
+        //bool RoleExists(Guid roleId);
 
-        [OperationContract]
-        bool IsUserInRole(Guid roleId, Guid userId);
+        //[OperationContract]
+        //bool IsUserInRole(Guid roleId, Guid userId);
         
-        [OperationContract]
-        bool InsertRole(Role role);
+        //[OperationContract]
+        //bool InsertRole(Role role);
 
-        [OperationContract]
-        bool UpdateRole(Role role);
+        //[OperationContract]
+        //bool UpdateRole(Role role);
 
-        [OperationContract]
-        bool DeleteRole(Guid id);
+        //[OperationContract]
+        //bool DeleteRole(Guid id);
 
-        [OperationContract]
-        IEnumerable<User> GetUsersInRole(Guid roleId);
+        //[OperationContract]
+        //IEnumerable<User> GetUsersInRole(Guid roleId);
        
         #endregion
@@ -74,15 +74,15 @@
         #region Application
 
-        [OperationContract]
-        Application GetApplication(Guid id);
+        //[OperationContract]
+        //Application GetApplication(Guid id);
 
-        [OperationContract]
-        Application InsertApplication(Application application);
+        //[OperationContract]
+        //Application InsertApplication(Application application);
 
-        [OperationContract]
-        bool DeleteApplication(Application application);
+        //[OperationContract]
+        //bool DeleteApplication(Application application);
 
-         [OperationContract]
-        IEnumerable<DataTransfer.Application> GetApplications();
+        // [OperationContract]
+        //IEnumerable<DataTransfer.Application> GetApplications();
 
         #endregion
@@ -90,6 +90,6 @@
         #region Membership
 
-        [OperationContract]
-        Membership InsertMembership(Membership membership);
+        //[OperationContract]
+        //Membership InsertMembership(Membership membership);
 
         #endregion
