diff --git a/.nuget/NuGet.Config b/.nuget/NuGet.Config new file mode 100644 index 0000000..67f8ea0 --- /dev/null +++ b/.nuget/NuGet.Config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.nuget/NuGet.exe b/.nuget/NuGet.exe new file mode 100644 index 0000000..324daa8 Binary files /dev/null and b/.nuget/NuGet.exe differ diff --git a/.nuget/NuGet.targets b/.nuget/NuGet.targets new file mode 100644 index 0000000..3f8c37b --- /dev/null +++ b/.nuget/NuGet.targets @@ -0,0 +1,144 @@ + + + + $(MSBuildProjectDirectory)\..\ + + + false + + + false + + + true + + + false + + + + + + + + + + + $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) + + + + + $(SolutionDir).nuget + + + + $(MSBuildProjectDirectory)\packages.$(MSBuildProjectName.Replace(' ', '_')).config + $(MSBuildProjectDirectory)\packages.$(MSBuildProjectName).config + + + + $(MSBuildProjectDirectory)\packages.config + $(PackagesProjectConfig) + + + + + $(NuGetToolsPath)\NuGet.exe + @(PackageSource) + + "$(NuGetExePath)" + mono --runtime=v4.0.30319 "$(NuGetExePath)" + + $(TargetDir.Trim('\\')) + + -RequireConsent + -NonInteractive + + "$(SolutionDir) " + "$(SolutionDir)" + + + $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir) + $(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols + + + + RestorePackages; + $(BuildDependsOn); + + + + + $(BuildDependsOn); + BuildPackage; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/RadGridViewEFCodeFirst.Data/App.config b/RadGridViewEFCodeFirst.Data/App.config new file mode 100644 index 0000000..4c09305 --- /dev/null +++ b/RadGridViewEFCodeFirst.Data/App.config @@ -0,0 +1,16 @@ + + + + +
+ + + + + + + + + + + \ No newline at end of file diff --git a/RadGridViewEFCodeFirst.Data/Contracts/IGenericRepository.cs b/RadGridViewEFCodeFirst.Data/Contracts/IGenericRepository.cs new file mode 100644 index 0000000..c03c352 --- /dev/null +++ b/RadGridViewEFCodeFirst.Data/Contracts/IGenericRepository.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Text; +using System.Threading.Tasks; + +namespace RadGridViewEFCodeFirst.Data.Contracts +{ + public interface IGenericRepository where T : class + { + IQueryable All(); + + IQueryable SearchFor(Expression> conditions); + + void Add(T entity); + + void Update(T entity); + + void Delete(T entity); + + void Detach(T entity); + } +} diff --git a/RadGridViewEFCodeFirst.Data/Contracts/IRadGridViewEFCodeFirstContext.cs b/RadGridViewEFCodeFirst.Data/Contracts/IRadGridViewEFCodeFirstContext.cs new file mode 100644 index 0000000..919eef7 --- /dev/null +++ b/RadGridViewEFCodeFirst.Data/Contracts/IRadGridViewEFCodeFirstContext.cs @@ -0,0 +1,24 @@ +using RadGridViewEFCodeFirst.Models; +using System; +using System.Collections.Generic; +using System.Data.Entity; +using System.Data.Entity.Infrastructure; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RadGridViewEFCodeFirst.Data.Contracts +{ + public interface IRadGridViewEFCodeFirstContext + { + IDbSet Orders { get; set; } + + IDbSet OrderTypes { get; set; } + + IDbSet Set() where T : class; + + DbEntityEntry Entry(T entity) where T : class; + + void SaveChanges(); + } +} diff --git a/RadGridViewEFCodeFirst.Data/Contracts/IRadGridViewEFCodeFirstData.cs b/RadGridViewEFCodeFirst.Data/Contracts/IRadGridViewEFCodeFirstData.cs new file mode 100644 index 0000000..a8d1445 --- /dev/null +++ b/RadGridViewEFCodeFirst.Data/Contracts/IRadGridViewEFCodeFirstData.cs @@ -0,0 +1,16 @@ +using RadGridViewEFCodeFirst.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RadGridViewEFCodeFirst.Data.Contracts +{ + public interface IRadGridViewEFCodeFirstData + { + IGenericRepository Orders { get; } + + IGenericRepository OrderTypes { get; } + } +} diff --git a/RadGridViewEFCodeFirst.Data/Migrations/Configuration.cs b/RadGridViewEFCodeFirst.Data/Migrations/Configuration.cs new file mode 100644 index 0000000..4506322 --- /dev/null +++ b/RadGridViewEFCodeFirst.Data/Migrations/Configuration.cs @@ -0,0 +1,22 @@ +namespace RadGridViewEFCodeFirst.Data.Migrations +{ + using System; + using System.Data.Entity; + using System.Data.Entity.Migrations; + using System.Linq; + + internal sealed class Configuration : DbMigrationsConfiguration + { + public Configuration() + { + AutomaticMigrationsEnabled = false; + this.AutomaticMigrationsEnabled = true; + this.AutomaticMigrationDataLossAllowed = true; + this.ContextKey = "RadGridViewEFCodeFirst.Data.RadGridViewEFCodeFirstContext"; + } + + protected override void Seed(RadGridViewEFCodeFirst.Data.RadGridViewEFCodeFirstContext context) + { + } + } +} diff --git a/RadGridViewEFCodeFirst.Data/Properties/AssemblyInfo.cs b/RadGridViewEFCodeFirst.Data/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..157d9ae --- /dev/null +++ b/RadGridViewEFCodeFirst.Data/Properties/AssemblyInfo.cs @@ -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("RadGridViewEFCodeFirst.Data")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("RadGridViewEFCodeFirst.Data")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[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("447a699c-8b6d-4a41-ba3a-72d22468d8cd")] + +// 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")] diff --git a/RadGridViewEFCodeFirst.Data/RadGridViewEFCodeFirst.Data.csproj b/RadGridViewEFCodeFirst.Data/RadGridViewEFCodeFirst.Data.csproj new file mode 100644 index 0000000..83413ab --- /dev/null +++ b/RadGridViewEFCodeFirst.Data/RadGridViewEFCodeFirst.Data.csproj @@ -0,0 +1,79 @@ + + + + + Debug + AnyCPU + {BBC3FD79-E151-469B-9A9D-A537FF24FA59} + Library + Properties + RadGridViewEFCodeFirst.Data + RadGridViewEFCodeFirst.Data + v4.5 + 512 + ..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.dll + + + ..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + {c363f91e-c205-4d31-be23-6d44b231ddd9} + RadGridViewEFCodeFirst.Models + + + + + + \ No newline at end of file diff --git a/RadGridViewEFCodeFirst.Data/RadGridViewEFCodeFirstContext.cs b/RadGridViewEFCodeFirst.Data/RadGridViewEFCodeFirstContext.cs new file mode 100644 index 0000000..5b5e2e1 --- /dev/null +++ b/RadGridViewEFCodeFirst.Data/RadGridViewEFCodeFirstContext.cs @@ -0,0 +1,36 @@ +using RadGridViewEFCodeFirst.Data.Contracts; +using RadGridViewEFCodeFirst.Data.Migrations; +using RadGridViewEFCodeFirst.Models; +using System; +using System.Collections.Generic; +using System.Data.Entity; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RadGridViewEFCodeFirst.Data +{ + public class RadGridViewEFCodeFirstContext : DbContext, IRadGridViewEFCodeFirstContext + { + public RadGridViewEFCodeFirstContext() + : base("RadGridViewEFCodeFirstConnection") + { + Database.SetInitializer(new MigrateDatabaseToLatestVersion()); + } + + public IDbSet Orders { get; set; } + + + public IDbSet OrderTypes { get; set; } + + public new IDbSet Set() where T : class + { + return base.Set(); + } + + public new void SaveChanges() + { + base.SaveChanges(); + } + } +} diff --git a/RadGridViewEFCodeFirst.Data/RadGridViewEFCodeFirstData.cs b/RadGridViewEFCodeFirst.Data/RadGridViewEFCodeFirstData.cs new file mode 100644 index 0000000..9be92dd --- /dev/null +++ b/RadGridViewEFCodeFirst.Data/RadGridViewEFCodeFirstData.cs @@ -0,0 +1,62 @@ +using RadGridViewEFCodeFirst.Data.Contracts; +using RadGridViewEFCodeFirst.Data.Repositories; +using RadGridViewEFCodeFirst.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RadGridViewEFCodeFirst.Data +{ + public class RadGridViewEFCodeFirstData : IRadGridViewEFCodeFirstData + { + private IRadGridViewEFCodeFirstContext context; + private IDictionary repositories; + + public RadGridViewEFCodeFirstData() + : this(new RadGridViewEFCodeFirstContext()) + { + } + + public RadGridViewEFCodeFirstData(IRadGridViewEFCodeFirstContext context) + { + this.context = context; + this.repositories = new Dictionary(); + } + + public IGenericRepository Orders + { + get + { + return this.GetRepository(); + } + } + + public IGenericRepository OrderTypes + { + get + { + return this.GetRepository(); + } + } + + public void SaveChanges() + { + this.context.SaveChanges(); + } + + private IGenericRepository GetRepository() where T : class + { + var typeOfModel = typeof(T); + if (!this.repositories.ContainsKey(typeOfModel)) + { + var type = typeof(GenericRepository); + + this.repositories.Add(typeOfModel, Activator.CreateInstance(type, this.context)); + } + + return (IGenericRepository)this.repositories[typeOfModel]; + } + } +} diff --git a/RadGridViewEFCodeFirst.Data/Repositories/GenericRepository.cs b/RadGridViewEFCodeFirst.Data/Repositories/GenericRepository.cs new file mode 100644 index 0000000..f5e450e --- /dev/null +++ b/RadGridViewEFCodeFirst.Data/Repositories/GenericRepository.cs @@ -0,0 +1,68 @@ +using RadGridViewEFCodeFirst.Data.Contracts; +using System; +using System.Collections.Generic; +using System.Data.Entity; +using System.Data.Entity.Infrastructure; +using System.Linq; +using System.Linq.Expressions; +using System.Text; +using System.Threading.Tasks; + +namespace RadGridViewEFCodeFirst.Data.Repositories +{ + public class GenericRepository : IGenericRepository where T : class + { + private IRadGridViewEFCodeFirstContext context; + private IDbSet set; + + public GenericRepository(IRadGridViewEFCodeFirstContext context) + { + this.context = context; + this.set = context.Set(); + } + + public IQueryable All() + { + return this.set.AsQueryable(); + } + + public IQueryable SearchFor(Expression> conditions) + { + return this.All().Where(conditions); + } + + public void Add(T entity) + { + this.set.Add(entity); + } + + public void Update(T entity) + { + var entry = AttachIfDetached(entity); + entry.State = EntityState.Modified; + } + + public void Delete(T entity) + { + var entry = AttachIfDetached(entity); + entry.State = EntityState.Deleted; + } + + public void Detach(T entity) + { + var entry = this.context.Entry(entity); + entry.State = EntityState.Detached; + } + + private DbEntityEntry AttachIfDetached(T entity) + { + var entry = this.context.Entry(entity); + if (entry.State == EntityState.Detached) + { + this.set.Attach(entity); + } + + return entry; + } + } +} diff --git a/RadGridViewEFCodeFirst.Data/packages.config b/RadGridViewEFCodeFirst.Data/packages.config new file mode 100644 index 0000000..9e8db31 --- /dev/null +++ b/RadGridViewEFCodeFirst.Data/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/RadGridViewEFCodeFirst.Models/App.config b/RadGridViewEFCodeFirst.Models/App.config new file mode 100644 index 0000000..4c09305 --- /dev/null +++ b/RadGridViewEFCodeFirst.Models/App.config @@ -0,0 +1,16 @@ + + + + +
+ + + + + + + + + + + \ No newline at end of file diff --git a/RadGridViewEFCodeFirst.Models/Order.cs b/RadGridViewEFCodeFirst.Models/Order.cs new file mode 100644 index 0000000..a95bf21 --- /dev/null +++ b/RadGridViewEFCodeFirst.Models/Order.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RadGridViewEFCodeFirst.Models +{ + public class Order + { + public int OrderId { get; set; } + + public int OrderTypeId { get; set; } + + public virtual OrderType OrderType { get; set; } + + public string Description { get; set; } + + public bool IsFinished { get; set; } + } +} diff --git a/RadGridViewEFCodeFirst.Models/OrderType.cs b/RadGridViewEFCodeFirst.Models/OrderType.cs new file mode 100644 index 0000000..8839a4f --- /dev/null +++ b/RadGridViewEFCodeFirst.Models/OrderType.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RadGridViewEFCodeFirst.Models +{ + public class OrderType + { + private ICollection orders; + + public OrderType() + { + this.orders = new HashSet(); + } + + public int OrderTypeId { get; set; } + + public virtual ICollection Orders + { + get + { + return this.orders; + } + set + { + this.orders = value; + } + } + + public string Description { get; set; } + } +} diff --git a/RadGridViewEFCodeFirst.Models/Properties/AssemblyInfo.cs b/RadGridViewEFCodeFirst.Models/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..ca2bc38 --- /dev/null +++ b/RadGridViewEFCodeFirst.Models/Properties/AssemblyInfo.cs @@ -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("RadGridViewEFCodeFirst.Models")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("RadGridViewEFCodeFirst.Models")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[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("d1d9bc26-99c6-4d24-8b58-1a6928b5458b")] + +// 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")] diff --git a/RadGridViewEFCodeFirst.Models/RadGridViewEFCodeFirst.Models.csproj b/RadGridViewEFCodeFirst.Models/RadGridViewEFCodeFirst.Models.csproj new file mode 100644 index 0000000..fab1143 --- /dev/null +++ b/RadGridViewEFCodeFirst.Models/RadGridViewEFCodeFirst.Models.csproj @@ -0,0 +1,70 @@ + + + + + Debug + AnyCPU + {C363F91E-C205-4D31-BE23-6D44B231DDD9} + Library + Properties + RadGridViewEFCodeFirst.Models + RadGridViewEFCodeFirst.Models + v4.5 + 512 + ..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.dll + + + ..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll + + + + + + + + + + + + + + + + + + Designer + + + + + + + \ No newline at end of file diff --git a/RadGridViewEFCodeFirst.Models/packages.config b/RadGridViewEFCodeFirst.Models/packages.config new file mode 100644 index 0000000..9e8db31 --- /dev/null +++ b/RadGridViewEFCodeFirst.Models/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/RadGridViewEFCodeFirst.WinFormsClient/App.config b/RadGridViewEFCodeFirst.WinFormsClient/App.config new file mode 100644 index 0000000..d6d41a5 --- /dev/null +++ b/RadGridViewEFCodeFirst.WinFormsClient/App.config @@ -0,0 +1,19 @@ + + + + +
+ + + + + + + + + + + + + + \ No newline at end of file diff --git a/RadGridViewEFCodeFirst.WinFormsClient/Form1.Designer.cs b/RadGridViewEFCodeFirst.WinFormsClient/Form1.Designer.cs new file mode 100644 index 0000000..a2f6edb --- /dev/null +++ b/RadGridViewEFCodeFirst.WinFormsClient/Form1.Designer.cs @@ -0,0 +1,68 @@ +namespace RadGridViewEFCodeFirst.WinFormsClient +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + Telerik.WinControls.UI.TableViewDefinition tableViewDefinition1 = new Telerik.WinControls.UI.TableViewDefinition(); + this.radGridView1 = new Telerik.WinControls.UI.RadGridView(); + ((System.ComponentModel.ISupportInitialize)(this.radGridView1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.radGridView1.MasterTemplate)).BeginInit(); + this.SuspendLayout(); + // + // radGridView1 + // + this.radGridView1.Location = new System.Drawing.Point(13, 12); + // + // + // + this.radGridView1.MasterTemplate.ViewDefinition = tableViewDefinition1; + this.radGridView1.Name = "radGridView1"; + this.radGridView1.Size = new System.Drawing.Size(750, 451); + this.radGridView1.TabIndex = 0; + this.radGridView1.Text = "radGridView1"; + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(775, 475); + this.Controls.Add(this.radGridView1); + this.Name = "Form1"; + this.Text = "Form1"; + ((System.ComponentModel.ISupportInitialize)(this.radGridView1.MasterTemplate)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.radGridView1)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private Telerik.WinControls.UI.RadGridView radGridView1; + } +} + diff --git a/RadGridViewEFCodeFirst.WinFormsClient/Form1.cs b/RadGridViewEFCodeFirst.WinFormsClient/Form1.cs new file mode 100644 index 0000000..8fb7b3f --- /dev/null +++ b/RadGridViewEFCodeFirst.WinFormsClient/Form1.cs @@ -0,0 +1,72 @@ +using RadGridViewEFCodeFirst.Data; +using RadGridViewEFCodeFirst.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Data.Entity.Infrastructure; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using Telerik.WinControls.UI; + +namespace RadGridViewEFCodeFirst.WinFormsClient +{ + public partial class Form1 : Form + { + private RadGridViewEFCodeFirstData data; + + public Form1() + { + InitializeComponent(); + + this.data = new RadGridViewEFCodeFirstData(); + //Uncomment to load data + //this.PopulateData(); + this.SetUpGrid(); + } + + private void SetUpGrid() + { + GridViewComboBoxColumn orderTypeColumn = new GridViewComboBoxColumn(); + orderTypeColumn.Name = "OrderTypeColumn"; + orderTypeColumn.HeaderText = "OrderType"; + orderTypeColumn.DataSource = this.data.OrderTypes.All().ToList(); + orderTypeColumn.ValueMember = "Description"; + orderTypeColumn.DisplayMember = "Description"; + orderTypeColumn.FieldName = "Orders"; + orderTypeColumn.Width = 200; + this.radGridView1.Columns.Add(orderTypeColumn); + } + + private void PopulateData() + { + for (int i = 1; i <= 100; i++) + { + OrderType orderType = new OrderType() + { + OrderTypeId = i, + Description = "Test" + i + }; + + this.data.OrderTypes.Add(orderType); + + Order order = new Order() + { + OrderId = i, + Description = "Description" + i, + OrderTypeId = orderType.OrderTypeId + }; + + this.data.Orders.Add(order); + + if (i % 10 == 0) + { + this.data.SaveChanges(); + } + } + } + } +} diff --git a/RadGridViewEFCodeFirst.WinFormsClient/Form1.resx b/RadGridViewEFCodeFirst.WinFormsClient/Form1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/RadGridViewEFCodeFirst.WinFormsClient/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/RadGridViewEFCodeFirst.WinFormsClient/Program.cs b/RadGridViewEFCodeFirst.WinFormsClient/Program.cs new file mode 100644 index 0000000..00efc21 --- /dev/null +++ b/RadGridViewEFCodeFirst.WinFormsClient/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace RadGridViewEFCodeFirst.WinFormsClient +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/RadGridViewEFCodeFirst.WinFormsClient/Properties/AssemblyInfo.cs b/RadGridViewEFCodeFirst.WinFormsClient/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..545341f --- /dev/null +++ b/RadGridViewEFCodeFirst.WinFormsClient/Properties/AssemblyInfo.cs @@ -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("RadGridViewEFCodeFirst.WinFormsClient")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("RadGridViewEFCodeFirst.WinFormsClient")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[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("8d03a5ea-98f8-4dc5-b406-7fcd8ac57a6f")] + +// 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")] diff --git a/RadGridViewEFCodeFirst.WinFormsClient/Properties/Resources.Designer.cs b/RadGridViewEFCodeFirst.WinFormsClient/Properties/Resources.Designer.cs new file mode 100644 index 0000000..b72e5f1 --- /dev/null +++ b/RadGridViewEFCodeFirst.WinFormsClient/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34209 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace RadGridViewEFCodeFirst.WinFormsClient.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("RadGridViewEFCodeFirst.WinFormsClient.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/RadGridViewEFCodeFirst.WinFormsClient/Properties/Resources.resx b/RadGridViewEFCodeFirst.WinFormsClient/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/RadGridViewEFCodeFirst.WinFormsClient/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/RadGridViewEFCodeFirst.WinFormsClient/Properties/Settings.Designer.cs b/RadGridViewEFCodeFirst.WinFormsClient/Properties/Settings.Designer.cs new file mode 100644 index 0000000..5c24e48 --- /dev/null +++ b/RadGridViewEFCodeFirst.WinFormsClient/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34209 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace RadGridViewEFCodeFirst.WinFormsClient.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/RadGridViewEFCodeFirst.WinFormsClient/Properties/Settings.settings b/RadGridViewEFCodeFirst.WinFormsClient/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/RadGridViewEFCodeFirst.WinFormsClient/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/RadGridViewEFCodeFirst.WinFormsClient/Properties/licenses.licx b/RadGridViewEFCodeFirst.WinFormsClient/Properties/licenses.licx new file mode 100644 index 0000000..d0e0155 --- /dev/null +++ b/RadGridViewEFCodeFirst.WinFormsClient/Properties/licenses.licx @@ -0,0 +1 @@ +Telerik.WinControls.UI.RadGridView, Telerik.WinControls.GridView, Version=2015.2.728.40, Culture=neutral, PublicKeyToken=5bb2a467cbec794e diff --git a/RadGridViewEFCodeFirst.WinFormsClient/RadGridViewEFCodeFirst.WinFormsClient.csproj b/RadGridViewEFCodeFirst.WinFormsClient/RadGridViewEFCodeFirst.WinFormsClient.csproj new file mode 100644 index 0000000..052e984 --- /dev/null +++ b/RadGridViewEFCodeFirst.WinFormsClient/RadGridViewEFCodeFirst.WinFormsClient.csproj @@ -0,0 +1,115 @@ + + + + + Debug + AnyCPU + {9EEA0332-1A7D-4373-9663-E1B33D472B9F} + WinExe + Properties + RadGridViewEFCodeFirst.WinFormsClient + RadGridViewEFCodeFirst.WinFormsClient + v4.5 + 512 + ..\ + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.dll + + + ..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll + + + + + + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + + Form1.cs + + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + {bbc3fd79-e151-469b-9a9d-a537ff24fa59} + RadGridViewEFCodeFirst.Data + + + {c363f91e-c205-4d31-be23-6d44b231ddd9} + RadGridViewEFCodeFirst.Models + + + + + + \ No newline at end of file diff --git a/RadGridViewEFCodeFirst.WinFormsClient/packages.config b/RadGridViewEFCodeFirst.WinFormsClient/packages.config new file mode 100644 index 0000000..9e8db31 --- /dev/null +++ b/RadGridViewEFCodeFirst.WinFormsClient/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/RadGridViewEFCodeFirst.sln b/RadGridViewEFCodeFirst.sln new file mode 100644 index 0000000..be1a398 --- /dev/null +++ b/RadGridViewEFCodeFirst.sln @@ -0,0 +1,41 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.31101.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RadGridViewEFCodeFirst.Models", "RadGridViewEFCodeFirst.Models\RadGridViewEFCodeFirst.Models.csproj", "{C363F91E-C205-4D31-BE23-6D44B231DDD9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RadGridViewEFCodeFirst.Data", "RadGridViewEFCodeFirst.Data\RadGridViewEFCodeFirst.Data.csproj", "{BBC3FD79-E151-469B-9A9D-A537FF24FA59}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RadGridViewEFCodeFirst.WinFormsClient", "RadGridViewEFCodeFirst.WinFormsClient\RadGridViewEFCodeFirst.WinFormsClient.csproj", "{9EEA0332-1A7D-4373-9663-E1B33D472B9F}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{D3731F87-CC80-4E58-863A-07CD244B4609}" + ProjectSection(SolutionItems) = preProject + .nuget\NuGet.Config = .nuget\NuGet.Config + .nuget\NuGet.exe = .nuget\NuGet.exe + .nuget\NuGet.targets = .nuget\NuGet.targets + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C363F91E-C205-4D31-BE23-6D44B231DDD9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C363F91E-C205-4D31-BE23-6D44B231DDD9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C363F91E-C205-4D31-BE23-6D44B231DDD9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C363F91E-C205-4D31-BE23-6D44B231DDD9}.Release|Any CPU.Build.0 = Release|Any CPU + {BBC3FD79-E151-469B-9A9D-A537FF24FA59}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BBC3FD79-E151-469B-9A9D-A537FF24FA59}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BBC3FD79-E151-469B-9A9D-A537FF24FA59}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BBC3FD79-E151-469B-9A9D-A537FF24FA59}.Release|Any CPU.Build.0 = Release|Any CPU + {9EEA0332-1A7D-4373-9663-E1B33D472B9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9EEA0332-1A7D-4373-9663-E1B33D472B9F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9EEA0332-1A7D-4373-9663-E1B33D472B9F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9EEA0332-1A7D-4373-9663-E1B33D472B9F}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal