├── .gitignore ├── ConnectionMappingSample ├── .nuget │ ├── NuGet.Config │ ├── NuGet.exe │ └── NuGet.targets ├── ConnectionMappingSample.sln └── ConnectionMappingSample │ ├── App_Start │ ├── BundleConfig.cs │ ├── FilterConfig.cs │ └── RouteConfig.cs │ ├── ConnectionMappingSample.csproj │ ├── Content │ ├── Site.css │ ├── bootstrap-responsive.css │ ├── bootstrap-responsive.min.css │ ├── bootstrap.css │ ├── bootstrap.min.css │ └── images │ │ ├── glyphicons-halflings-white.png │ │ └── glyphicons-halflings.png │ ├── Controllers │ ├── AccountController.cs │ └── HomeController.cs │ ├── Global.asax │ ├── Global.asax.cs │ ├── Hubs │ └── ChatHub.cs │ ├── Infrastructure │ └── SafeCollection.cs │ ├── Models │ └── LoginModel.cs │ ├── Properties │ ├── AssemblyInfo.cs │ └── PublishProfiles │ │ ├── Default Settings (2).pubxml │ │ └── Default Settings.pubxml │ ├── Scripts │ ├── apps │ │ └── chat.js │ ├── bootstrap.js │ ├── bootstrap.min.js │ ├── jquery-1.8.3.intellisense.js │ ├── jquery-1.8.3.js │ ├── jquery-1.8.3.min.js │ ├── jquery.signalR-1.1.0-beta1.js │ ├── jquery.signalR-1.1.0-beta1.min.js │ ├── jquery.validate-vsdoc.js │ ├── jquery.validate.js │ ├── jquery.validate.min.js │ ├── jquery.validate.unobtrusive.js │ ├── jquery.validate.unobtrusive.min.js │ ├── knockout-2.2.0.debug.js │ └── knockout-2.2.0.js │ ├── Views │ ├── Account │ │ └── Login.cshtml │ ├── Home │ │ └── Index.cshtml │ ├── Shared │ │ ├── Error.cshtml │ │ └── _Layout.cshtml │ ├── Web.config │ └── _ViewStart.cshtml │ ├── Web.Debug.config │ ├── Web.Release.config │ ├── Web.config │ └── packages.config ├── MultiLayerSignalRSample ├── .nuget │ ├── NuGet.Config │ ├── NuGet.exe │ └── NuGet.targets ├── MultiLayerSignalRSample.API.Model │ ├── MultiLayerSignalRSample.API.Model.csproj │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── RequestCommands │ │ ├── IRequestCommand.cs │ │ └── PaginatedRequestCommand.cs │ ├── RequestModels │ │ └── ChatMessageRequestModel.cs │ ├── Validation │ │ ├── MaximumAttribute.cs │ │ └── MinimumAttribute.cs │ └── packages.config ├── MultiLayerSignalRSample.API │ ├── App.config │ ├── Config │ │ ├── SignalRAutofac.cs │ │ ├── WebApiAutofac.cs │ │ ├── WebApiConfig.cs │ │ └── WebApiRouteConfig.cs │ ├── Controllers │ │ ├── ChatMessagesController.cs │ │ └── Core │ │ │ ├── HubController.cs │ │ │ ├── HubControllerBase.cs │ │ │ └── HubControllerOfTHub.cs │ ├── Formatting │ │ └── SuppressedRequiredMemberSelector.cs │ ├── Hubs │ │ └── ChatHub.cs │ ├── MultiLayerSignalRSample.API.csproj │ ├── Properties │ │ └── AssemblyInfo.cs │ └── packages.config ├── MultiLayerSignalRSample.Domain │ ├── App.config │ ├── Entities │ │ ├── ChatMessage.cs │ │ ├── Core │ │ │ ├── ChatEntitiesContext.cs │ │ │ ├── EntitiesContextBase.cs │ │ │ ├── EntityRepository.cs │ │ │ ├── IEntitiesContext.cs │ │ │ ├── IEntity.cs │ │ │ ├── IEntityRepository'1.cs │ │ │ ├── IEntityRepository'2.cs │ │ │ └── IRepository.cs │ │ ├── Extensions │ │ │ ├── QueryableExtensions.cs │ │ │ ├── RoleRepositoryExtensions.cs │ │ │ ├── UserInRoleRepositoryExtensions.cs │ │ │ └── UserRepositoryExtensions.cs │ │ ├── HubConnection.cs │ │ ├── PaginatedList.cs │ │ ├── PrivateChatMessage.cs │ │ ├── Role.cs │ │ ├── User.cs │ │ └── UserInRole.cs │ ├── Migrations │ │ ├── 201304240655220_init.Designer.cs │ │ ├── 201304240655220_init.cs │ │ ├── 201304240655220_init.resx │ │ ├── 201304240710405_ExtendedUserManagement.Designer.cs │ │ ├── 201304240710405_ExtendedUserManagement.cs │ │ ├── 201304240710405_ExtendedUserManagement.resx │ │ └── Configuration.cs │ ├── MultiLayerSignalRSample.Domain.csproj │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── RoleConstants.cs │ ├── Services │ │ ├── IMembershipService.cs │ │ ├── MembershipService.cs │ │ ├── OperationResult.cs │ │ ├── OperationResultOfTEntity.cs │ │ ├── UserWithRoles.cs │ │ └── ValidUserContext.cs │ └── packages.config ├── MultiLayerSignalRSample.sln ├── MultiLayerSignalRSample │ ├── AccountController.generated.cs │ ├── App_Start │ │ ├── AutofacMvc.cs │ │ ├── BundleConfig.cs │ │ ├── FilterConfig.cs │ │ └── RouteConfig.cs │ ├── Content │ │ ├── Site.css │ │ ├── bootstrap-responsive.css │ │ ├── bootstrap-responsive.min.css │ │ ├── bootstrap.css │ │ ├── bootstrap.min.css │ │ ├── font-awesome-ie7.min.css │ │ ├── font-awesome.css │ │ ├── font-awesome.min.css │ │ ├── font │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.svg │ │ │ ├── fontawesome-webfont.ttf │ │ │ └── fontawesome-webfont.woff │ │ ├── ie10mobile.css │ │ ├── images │ │ │ ├── glyphicons-halflings-white.png │ │ │ └── glyphicons-halflings.png │ │ ├── toastr.css │ │ └── toastr.min.css │ ├── Controllers │ │ ├── AccountController.cs │ │ └── HomeController.cs │ ├── Global.asax │ ├── Global.asax.cs │ ├── HomeController.generated.cs │ ├── Infrastructure │ │ └── SafeCollection.cs │ ├── Models │ │ ├── LoginModel.cs │ │ └── RegisterModel.cs │ ├── MultiLayerSignalRSample.csproj │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ └── PublishProfiles │ │ │ ├── Default Settings (2).pubxml │ │ │ └── Default Settings.pubxml │ ├── Scripts │ │ ├── GPL-LICENSE.txt │ │ ├── MIT-LICENSE.txt │ │ ├── README.txt │ │ ├── TrafficCop-amd.js │ │ ├── TrafficCop-amd.min.gz.js │ │ ├── TrafficCop-amd.min.js │ │ ├── TrafficCop.js │ │ ├── TrafficCop.min.gz.js │ │ ├── TrafficCop.min.js │ │ ├── amplify-vsdoc.js │ │ ├── amplify.js │ │ ├── amplify.min.js │ │ ├── app │ │ │ ├── binder.js │ │ │ ├── boot │ │ │ │ └── main.js │ │ │ ├── bootstrapper.js │ │ │ ├── chat.js │ │ │ ├── config.js │ │ │ ├── connection-boot.js │ │ │ ├── events.js │ │ │ ├── ko.debug.helpers.js │ │ │ ├── vm.chatMessages.js │ │ │ ├── vm.js │ │ │ └── vm.users.js │ │ ├── bootstrap.js │ │ ├── bootstrap.min.js │ │ ├── infuser-amd.js │ │ ├── infuser-amd.min.gz.js │ │ ├── infuser-amd.min.js │ │ ├── infuser.js │ │ ├── infuser.min.gz.js │ │ ├── infuser.min.js │ │ ├── jquery-1.9.1.intellisense.js │ │ ├── jquery-1.9.1.js │ │ ├── jquery-1.9.1.min.js │ │ ├── jquery-1.9.1.min.map │ │ ├── jquery.signalR-1.1.0-beta1.js │ │ ├── jquery.signalR-1.1.0-beta1.min.js │ │ ├── jquery.validate-vsdoc.js │ │ ├── jquery.validate.js │ │ ├── jquery.validate.min.js │ │ ├── jquery.validate.unobtrusive.js │ │ ├── jquery.validate.unobtrusive.min.js │ │ ├── json2.js │ │ ├── json2.min.js │ │ ├── knockout-2.2.0.debug.js │ │ ├── knockout-2.2.0.js │ │ ├── koExternalTemplateEngine-amd.js │ │ ├── koExternalTemplateEngine-amd.min.js │ │ ├── koExternalTemplateEngine.js │ │ ├── koExternalTemplateEngine.min.js │ │ ├── koExternalTemplateEngine_all.js │ │ ├── koExternalTemplateEngine_all.min.js │ │ ├── moment.js │ │ ├── moment.min.js │ │ ├── r.js │ │ ├── require.js │ │ ├── sammy-0.7.4.js │ │ ├── sammy-0.7.4.min.js │ │ ├── toastr.js │ │ ├── toastr.min.js │ │ ├── underscore.js │ │ └── underscore.min.js │ ├── SharedController.generated.cs │ ├── T4MVC.cs │ ├── T4MVC.tt │ ├── T4MVC.tt.hooks.t4 │ ├── T4MVC.tt.settings.xml │ ├── Views │ │ ├── Account │ │ │ ├── Login.cshtml │ │ │ └── Register.cshtml │ │ ├── Home │ │ │ └── Index.cshtml │ │ ├── Shared │ │ │ ├── Error.cshtml │ │ │ └── _Layout.cshtml │ │ ├── Web.config │ │ └── _ViewStart.cshtml │ ├── Web.Debug.config │ ├── Web.Release.config │ ├── Web.config │ └── packages.config └── README.md ├── README.md ├── RedisScaleOutSample ├── .nuget │ ├── NuGet.Config │ ├── NuGet.exe │ └── NuGet.targets ├── RedisScaleOutSample.sln ├── RedisScaleOutSample │ ├── Hubs │ │ └── ChatHub.cs │ ├── Index.html │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── RedisScaleOutSample.csproj │ ├── Scripts │ │ ├── jquery-1.6.4-vsdoc.js │ │ ├── jquery-1.6.4.js │ │ ├── jquery-1.6.4.min.js │ │ ├── jquery.signalR-2.0.0-beta2.js │ │ └── jquery.signalR-2.0.0-beta2.min.js │ ├── Startup.cs │ ├── Web.Debug.config │ ├── Web.Release.config │ ├── Web.config │ └── packages.config └── run.ps1 └── SignalRIoCScopeSample ├── .nuget ├── NuGet.Config ├── NuGet.exe └── NuGet.targets ├── SignalRIoCScopeSample.sln └── SignalRIoCScopeSample ├── Bar.cs ├── Broadcaster.cs ├── Foo.cs ├── Global.asax ├── Global.asax.cs ├── Index.html ├── PingHub.cs ├── Properties └── AssemblyInfo.cs ├── Scripts ├── jquery-1.6.4-vsdoc.js ├── jquery-1.6.4.js ├── jquery-1.6.4.min.js ├── jquery.signalR-1.0.1.js └── jquery.signalR-1.0.1.min.js ├── SignalRIoCScopeSample.csproj ├── Web.Debug.config ├── Web.Release.config ├── Web.config └── packages.config /.gitignore: -------------------------------------------------------------------------------- 1 | # Build Folders (you can keep bin if you'd like, to store dlls and pdbs) 2 | [Bb]in/ 3 | [Oo]bj/ 4 | 5 | # mstest test results 6 | TestResults 7 | 8 | ## Ignore Visual Studio temporary files, build results, and 9 | ## files generated by popular Visual Studio add-ons. 10 | 11 | # User-specific files 12 | *.suo 13 | *.user 14 | *.sln.docstates 15 | 16 | # Build results 17 | [Dd]ebug/ 18 | [Rr]elease/ 19 | x64/ 20 | *_i.c 21 | *_p.c 22 | *.ilk 23 | *.meta 24 | *.obj 25 | *.pch 26 | *.pdb 27 | *.pgc 28 | *.pgd 29 | *.rsp 30 | *.sbr 31 | *.tlb 32 | *.tli 33 | *.tlh 34 | *.tmp 35 | *.log 36 | *.vspscc 37 | *.vssscc 38 | .builds 39 | 40 | # Visual C++ cache files 41 | ipch/ 42 | *.aps 43 | *.ncb 44 | *.opensdf 45 | *.sdf 46 | 47 | # Visual Studio profiler 48 | *.psess 49 | *.vsp 50 | *.vspx 51 | 52 | # Guidance Automation Toolkit 53 | *.gpState 54 | 55 | # ReSharper is a .NET coding add-in 56 | _ReSharper* 57 | 58 | # NCrunch 59 | *.ncrunch* 60 | .*crunch*.local.xml 61 | 62 | # Installshield output folder 63 | [Ee]xpress 64 | 65 | # DocProject is a documentation generator add-in 66 | DocProject/buildhelp/ 67 | DocProject/Help/*.HxT 68 | DocProject/Help/*.HxC 69 | DocProject/Help/*.hhc 70 | DocProject/Help/*.hhk 71 | DocProject/Help/*.hhp 72 | DocProject/Help/Html2 73 | DocProject/Help/html 74 | 75 | # Click-Once directory 76 | publish 77 | 78 | # Publish Web Output 79 | *.Publish.xml 80 | 81 | # NuGet Packages Directory 82 | packages 83 | 84 | # Windows Azure Build Output 85 | csx 86 | *.build.csdef 87 | 88 | # Windows Store app package directory 89 | AppPackages/ 90 | 91 | # Others 92 | [Bb]in 93 | [Oo]bj 94 | sql 95 | TestResults 96 | [Tt]est[Rr]esult* 97 | *.Cache 98 | ClientBin 99 | [Ss]tyle[Cc]op.* 100 | ~$* 101 | *.dbmdl 102 | Generated_Code #added for RIA/Silverlight projects 103 | 104 | # Backup & report files from converting an old project file to a newer 105 | # Visual Studio version. Backup files are not needed, because we have git ;-) 106 | _UpgradeReport_Files/ 107 | Backup*/ 108 | UpgradeLog*.XML 109 | 110 | # Custom 111 | _docs 112 | artifacts 113 | .pubxml 114 | .pubxml.user -------------------------------------------------------------------------------- /ConnectionMappingSample/.nuget/NuGet.Config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ConnectionMappingSample/.nuget/NuGet.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tugberkugurlu/SignalRSamples/7d66f037ee3d9e3f718ff56627b6eeedee32961f/ConnectionMappingSample/.nuget/NuGet.exe -------------------------------------------------------------------------------- /ConnectionMappingSample/ConnectionMappingSample.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConnectionMappingSample", "ConnectionMappingSample\ConnectionMappingSample.csproj", "{23A03327-08C7-4FA0-A468-03C174A4D380}" 5 | EndProject 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{F1E7141F-86D0-4737-A3C1-FB5798311938}" 7 | ProjectSection(SolutionItems) = preProject 8 | .nuget\NuGet.Config = .nuget\NuGet.Config 9 | .nuget\NuGet.exe = .nuget\NuGet.exe 10 | .nuget\NuGet.targets = .nuget\NuGet.targets 11 | EndProjectSection 12 | EndProject 13 | Global 14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 15 | Debug|Any CPU = Debug|Any CPU 16 | Release|Any CPU = Release|Any CPU 17 | EndGlobalSection 18 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 19 | {23A03327-08C7-4FA0-A468-03C174A4D380}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 20 | {23A03327-08C7-4FA0-A468-03C174A4D380}.Debug|Any CPU.Build.0 = Debug|Any CPU 21 | {23A03327-08C7-4FA0-A468-03C174A4D380}.Release|Any CPU.ActiveCfg = Release|Any CPU 22 | {23A03327-08C7-4FA0-A468-03C174A4D380}.Release|Any CPU.Build.0 = Release|Any CPU 23 | EndGlobalSection 24 | GlobalSection(SolutionProperties) = preSolution 25 | HideSolutionNode = FALSE 26 | EndGlobalSection 27 | EndGlobal 28 | -------------------------------------------------------------------------------- /ConnectionMappingSample/ConnectionMappingSample/App_Start/BundleConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Optimization; 3 | 4 | namespace ConnectionMappingSample { 5 | public class BundleConfig { 6 | // For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725 7 | public static void RegisterBundles(BundleCollection bundles) { 8 | bundles.Add(new ScriptBundle("~/bundles/jquery").Include( 9 | "~/Scripts/jquery-{version}.js")); 10 | 11 | bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include( 12 | "~/Scripts/jquery-ui-{version}.js")); 13 | 14 | bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( 15 | "~/Scripts/jquery.unobtrusive*", 16 | "~/Scripts/jquery.validate*")); 17 | 18 | // Use the development version of Modernizr to develop with and learn from. Then, when you're 19 | // ready for production, use the build tool at http://modernizr.com to pick only the tests you need. 20 | bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( 21 | "~/Scripts/modernizr-*")); 22 | 23 | bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css")); 24 | 25 | bundles.Add(new StyleBundle("~/Content/themes/base/css").Include( 26 | "~/Content/themes/base/jquery.ui.core.css", 27 | "~/Content/themes/base/jquery.ui.resizable.css", 28 | "~/Content/themes/base/jquery.ui.selectable.css", 29 | "~/Content/themes/base/jquery.ui.accordion.css", 30 | "~/Content/themes/base/jquery.ui.autocomplete.css", 31 | "~/Content/themes/base/jquery.ui.button.css", 32 | "~/Content/themes/base/jquery.ui.dialog.css", 33 | "~/Content/themes/base/jquery.ui.slider.css", 34 | "~/Content/themes/base/jquery.ui.tabs.css", 35 | "~/Content/themes/base/jquery.ui.datepicker.css", 36 | "~/Content/themes/base/jquery.ui.progressbar.css", 37 | "~/Content/themes/base/jquery.ui.theme.css")); 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /ConnectionMappingSample/ConnectionMappingSample/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Mvc; 3 | 4 | namespace ConnectionMappingSample { 5 | public class FilterConfig { 6 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) { 7 | filters.Add(new HandleErrorAttribute()); 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /ConnectionMappingSample/ConnectionMappingSample/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace ConnectionMappingSample { 9 | public class RouteConfig { 10 | public static void RegisterRoutes(RouteCollection routes) { 11 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 12 | 13 | routes.MapRoute( 14 | name: "Default", 15 | url: "{controller}/{action}/{id}", 16 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 17 | ); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /ConnectionMappingSample/ConnectionMappingSample/Content/Site.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin-top: 15px; 3 | } 4 | 5 | legend { 6 | font-size: 1.2em; 7 | font-weight: bold; 8 | } 9 | 10 | textarea { 11 | min-height: 75px; 12 | } 13 | 14 | .editor-label { 15 | margin: 1em 0 0 0; 16 | } 17 | 18 | .editor-field { 19 | margin: 0.5em 0 0 0; 20 | } 21 | 22 | 23 | /* Styles for validation helpers 24 | -----------------------------------------------------------*/ 25 | .field-validation-error { 26 | color: #f00; 27 | } 28 | 29 | .field-validation-valid { 30 | display: none; 31 | } 32 | 33 | .input-validation-error { 34 | border: 1px solid #f00; 35 | background-color: #fee; 36 | } 37 | 38 | .validation-summary-errors { 39 | font-weight: bold; 40 | color: #f00; 41 | } 42 | 43 | .validation-summary-valid { 44 | display: none; 45 | } 46 | -------------------------------------------------------------------------------- /ConnectionMappingSample/ConnectionMappingSample/Content/images/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tugberkugurlu/SignalRSamples/7d66f037ee3d9e3f718ff56627b6eeedee32961f/ConnectionMappingSample/ConnectionMappingSample/Content/images/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /ConnectionMappingSample/ConnectionMappingSample/Content/images/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tugberkugurlu/SignalRSamples/7d66f037ee3d9e3f718ff56627b6eeedee32961f/ConnectionMappingSample/ConnectionMappingSample/Content/images/glyphicons-halflings.png -------------------------------------------------------------------------------- /ConnectionMappingSample/ConnectionMappingSample/Controllers/AccountController.cs: -------------------------------------------------------------------------------- 1 | using ConnectionMappingSample.Models; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Web; 6 | using System.Web.Mvc; 7 | using System.Web.Security; 8 | 9 | namespace ConnectionMappingSample.Controllers { 10 | 11 | public class AccountController : Controller { 12 | 13 | public ViewResult Login() { 14 | 15 | return View(); 16 | } 17 | 18 | [HttpPost] 19 | [ActionName("Login")] 20 | public ActionResult PostLogin(LoginModel loginModel) { 21 | 22 | if (ModelState.IsValid) { 23 | 24 | FormsAuthentication.SetAuthCookie(loginModel.Name, true); 25 | return RedirectToAction("index", "home"); 26 | } 27 | 28 | return View(loginModel); 29 | } 30 | 31 | [HttpPost] 32 | [ActionName("SignOut")] 33 | public ActionResult PostSignOut() { 34 | 35 | FormsAuthentication.SignOut(); 36 | return RedirectToAction("index", "home"); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /ConnectionMappingSample/ConnectionMappingSample/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | 7 | namespace ConnectionMappingSample.Controllers { 8 | 9 | [Authorize] 10 | public class HomeController : Controller { 11 | 12 | public ViewResult Index() { 13 | 14 | return View(); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /ConnectionMappingSample/ConnectionMappingSample/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="ConnectionMappingSample.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /ConnectionMappingSample/ConnectionMappingSample/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Http; 6 | using System.Web.Mvc; 7 | using System.Web.Optimization; 8 | using System.Web.Routing; 9 | using Microsoft.AspNet.SignalR; 10 | 11 | namespace ConnectionMappingSample { 12 | // Note: For instructions on enabling IIS6 or IIS7 classic mode, 13 | // visit http://go.microsoft.com/?LinkId=9394801 14 | 15 | public class MvcApplication : System.Web.HttpApplication { 16 | 17 | protected void Application_Start() { 18 | 19 | RouteTable.Routes.MapHubs(); 20 | 21 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 22 | RouteConfig.RegisterRoutes(RouteTable.Routes); 23 | BundleConfig.RegisterBundles(BundleTable.Bundles); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /ConnectionMappingSample/ConnectionMappingSample/Infrastructure/SafeCollection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace ConnectionMappingSample.Infrastructure { 7 | public class SafeCollection { 8 | } 9 | } -------------------------------------------------------------------------------- /ConnectionMappingSample/ConnectionMappingSample/Models/LoginModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Web; 6 | 7 | namespace ConnectionMappingSample.Models { 8 | 9 | public class LoginModel { 10 | 11 | [Required] 12 | public string Name { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /ConnectionMappingSample/ConnectionMappingSample/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ConnectionMappingSample")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ConnectionMappingSample")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("57be3a18-b27f-4b93-9bd2-ac2b9d8230b5")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /ConnectionMappingSample/ConnectionMappingSample/Properties/PublishProfiles/Default Settings (2).pubxml: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | MSDeploy 9 | Release 10 | Any CPU 11 | http://signalr-webinar.cloudapp.net/ 12 | False 13 | https://signalr-webinar.cloudapp.net:8173/msdeploy.axd 14 | ChatSample 15 | 16 | True 17 | WMSVC 18 | True 19 | SIGNALR-WEB2\signalruser 20 | <_SavePWD>True 21 | 22 | -------------------------------------------------------------------------------- /ConnectionMappingSample/ConnectionMappingSample/Properties/PublishProfiles/Default Settings.pubxml: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | MSDeploy 9 | Release 10 | Any CPU 11 | http://SIGNALR-WEB1:80/ 12 | False 13 | https://signalr-webinar.cloudapp.net:8172/msdeploy.axd 14 | ChatSample 15 | 16 | True 17 | WMSVC 18 | True 19 | SIGNALR-WEB1\signalruser 20 | <_SavePWD>True 21 | 22 | -------------------------------------------------------------------------------- /ConnectionMappingSample/ConnectionMappingSample/Scripts/jquery.validate.unobtrusive.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | ** Unobtrusive validation support library for jQuery and jQuery Validate 3 | ** Copyright (C) Microsoft Corporation. All rights reserved. 4 | */ 5 | (function(a){var d=a.validator,b,e="unobtrusiveValidation";function c(a,b,c){a.rules[b]=c;if(a.message)a.messages[b]=a.message}function j(a){return a.replace(/^\s+|\s+$/g,"").split(/\s*,\s*/g)}function f(a){return a.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g,"\\$1")}function h(a){return a.substr(0,a.lastIndexOf(".")+1)}function g(a,b){if(a.indexOf("*.")===0)a=a.replace("*.",b);return a}function m(c,d){var b=a(this).find("[data-valmsg-for='"+f(d[0].name)+"']"),e=a.parseJSON(b.attr("data-valmsg-replace"))!==false;b.removeClass("field-validation-valid").addClass("field-validation-error");c.data("unobtrusiveContainer",b);if(e){b.empty();c.removeClass("input-validation-error").appendTo(b)}else c.hide()}function l(e,d){var c=a(this).find("[data-valmsg-summary=true]"),b=c.find("ul");if(b&&b.length&&d.errorList.length){b.empty();c.addClass("validation-summary-errors").removeClass("validation-summary-valid");a.each(d.errorList,function(){a("
  • ").html(this.message).appendTo(b)})}}function k(c){var b=c.data("unobtrusiveContainer"),d=a.parseJSON(b.attr("data-valmsg-replace"));if(b){b.addClass("field-validation-valid").removeClass("field-validation-error");c.removeData("unobtrusiveContainer");d&&b.empty()}}function n(){var b=a(this);b.data("validator").resetForm();b.find(".validation-summary-errors").addClass("validation-summary-valid").removeClass("validation-summary-errors");b.find(".field-validation-error").addClass("field-validation-valid").removeClass("field-validation-error").removeData("unobtrusiveContainer").find(">*").removeData("unobtrusiveContainer")}function i(c){var b=a(c),d=b.data(e),f=a.proxy(n,c);if(!d){d={options:{errorClass:"input-validation-error",errorElement:"span",errorPlacement:a.proxy(m,c),invalidHandler:a.proxy(l,c),messages:{},rules:{},success:a.proxy(k,c)},attachValidation:function(){b.unbind("reset."+e,f).bind("reset."+e,f).validate(this.options)},validate:function(){b.validate();return b.valid()}};b.data(e,d)}return d}d.unobtrusive={adapters:[],parseElement:function(b,h){var d=a(b),f=d.parents("form")[0],c,e,g;if(!f)return;c=i(f);c.options.rules[b.name]=e={};c.options.messages[b.name]=g={};a.each(this.adapters,function(){var c="data-val-"+this.name,i=d.attr(c),h={};if(i!==undefined){c+="-";a.each(this.params,function(){h[this]=d.attr(c+this)});this.adapt({element:b,form:f,message:i,params:h,rules:e,messages:g})}});a.extend(e,{__dummy__:true});!h&&c.attachValidation()},parse:function(b){var c=a(b).parents("form").andSelf().add(a(b).find("form")).filter("form");a(b).find(":input[data-val=true]").each(function(){d.unobtrusive.parseElement(this,true)});c.each(function(){var a=i(this);a&&a.attachValidation()})}};b=d.unobtrusive.adapters;b.add=function(c,a,b){if(!b){b=a;a=[]}this.push({name:c,params:a,adapt:b});return this};b.addBool=function(a,b){return this.add(a,function(d){c(d,b||a,true)})};b.addMinMax=function(e,g,f,a,d,b){return this.add(e,[d||"min",b||"max"],function(b){var e=b.params.min,d=b.params.max;if(e&&d)c(b,a,[e,d]);else if(e)c(b,g,e);else d&&c(b,f,d)})};b.addSingleVal=function(a,b,d){return this.add(a,[b||"val"],function(e){c(e,d||a,e.params[b])})};d.addMethod("__dummy__",function(){return true});d.addMethod("regex",function(b,c,d){var a;if(this.optional(c))return true;a=(new RegExp(d)).exec(b);return a&&a.index===0&&a[0].length===b.length});d.addMethod("nonalphamin",function(c,d,b){var a;if(b){a=c.match(/\W/g);a=a&&a.length>=b}return a});b.addSingleVal("accept","exts").addSingleVal("regex","pattern");b.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url");b.addMinMax("length","minlength","maxlength","rangelength").addMinMax("range","min","max","range");b.add("equalto",["other"],function(b){var i=h(b.element.name),j=b.params.other,d=g(j,i),e=a(b.form).find(":input[name='"+f(d)+"']")[0];c(b,"equalTo",e)});b.add("required",function(a){(a.element.tagName.toUpperCase()!=="INPUT"||a.element.type.toUpperCase()!=="CHECKBOX")&&c(a,"required",true)});b.add("remote",["url","type","additionalfields"],function(b){var d={url:b.params.url,type:b.params.type||"GET",data:{}},e=h(b.element.name);a.each(j(b.params.additionalfields||b.element.name),function(i,h){var c=g(h,e);d.data[c]=function(){return a(b.form).find(":input[name='"+f(c)+"']").val()}});c(b,"remote",d)});b.add("password",["min","nonalphamin","regex"],function(a){a.params.min&&c(a,"minlength",a.params.min);a.params.nonalphamin&&c(a,"nonalphamin",a.params.nonalphamin);a.params.regex&&c(a,"regex",a.params.regex)});a(function(){d.unobtrusive.parse(document)})})(jQuery); -------------------------------------------------------------------------------- /ConnectionMappingSample/ConnectionMappingSample/Views/Account/Login.cshtml: -------------------------------------------------------------------------------- 1 | @model ConnectionMappingSample.Models.LoginModel 2 | 3 | @{ 4 | ViewBag.Title = "Login"; 5 | } 6 | 7 |

    Login

    8 | 9 | @using (Html.BeginForm()) { 10 | 11 | @Html.EditorForModel() 12 | 13 | } -------------------------------------------------------------------------------- /ConnectionMappingSample/ConnectionMappingSample/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Chat, Chat, Chat..."; 3 | } 4 | 5 | @section head { 6 | 7 | 42 | } 43 | 44 | @section scripts { 45 | 46 | 47 | 48 | } 49 | 50 |

    Chat, Chat, Chat...

    51 | 52 |
    53 | Hello @User.Identity.Name! Start chating... 54 |
    55 | 56 |
    57 | You are in a private chat with @@! Exit from private chat? 58 |
    59 | 60 |
    61 | 72 |
    73 |
      74 |
    • 75 | 76 |
    • 77 |
    78 |
    79 |
    -------------------------------------------------------------------------------- /ConnectionMappingSample/ConnectionMappingSample/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = null; 3 | } 4 | 5 | 6 | 7 | 8 | 9 | Error 10 | 11 | 12 |

    13 | Sorry, an error occurred while processing your request. 14 |

    15 | 16 | -------------------------------------------------------------------------------- /ConnectionMappingSample/ConnectionMappingSample/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | @ViewBag.Title 7 | 8 | 9 | 10 | @RenderSection("head", required: false) 11 | 12 | 13 |
    14 |
    15 |
    16 | @if (User.Identity.IsAuthenticated) { 17 |
    18 | @using (Html.BeginForm("signout", "account")) { 19 | 20 | } 21 |
    22 | } 23 | @RenderBody() 24 |
    25 |
    26 |
    27 | 28 | 29 | 30 | 31 | @RenderSection("scripts", required: false) 32 | 33 | -------------------------------------------------------------------------------- /ConnectionMappingSample/ConnectionMappingSample/Views/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 |
    7 |
    8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 40 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /ConnectionMappingSample/ConnectionMappingSample/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } -------------------------------------------------------------------------------- /ConnectionMappingSample/ConnectionMappingSample/Web.Debug.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /ConnectionMappingSample/ConnectionMappingSample/Web.Release.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | -------------------------------------------------------------------------------- /ConnectionMappingSample/ConnectionMappingSample/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | 9 |
    10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /ConnectionMappingSample/ConnectionMappingSample/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/.nuget/NuGet.Config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/.nuget/NuGet.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tugberkugurlu/SignalRSamples/7d66f037ee3d9e3f718ff56627b6eeedee32961f/MultiLayerSignalRSample/.nuget/NuGet.exe -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.API.Model/MultiLayerSignalRSample.API.Model.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {42DBF4E8-9C16-4DA2-8C9B-6E110F21CBA6} 8 | Library 9 | Properties 10 | MultiLayerSignalRSample.API.Model 11 | MultiLayerSignalRSample.API.Model 12 | v4.5 13 | 512 14 | ..\ 15 | true 16 | 17 | 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | 26 | 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | ..\packages\WebApiDoodle.Net.Http.Client.Model.2.0.1\lib\net40\WebApiDoodle.Net.Http.Client.Model.dll 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 67 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.API.Model/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("MultiLayerSignalRSample.API.Model")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("MultiLayerSignalRSample.API.Model")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("da11c62b-b368-4c27-991d-3477fc6c7d25")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.API.Model/RequestCommands/IRequestCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace MultiLayerSignalRSample.API.Model.RequestCommands 8 | { 9 | public interface IRequestCommand 10 | { 11 | } 12 | } -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.API.Model/RequestCommands/PaginatedRequestCommand.cs: -------------------------------------------------------------------------------- 1 | using MultiLayerSignalRSample.API.Model.Validation; 2 | 3 | namespace MultiLayerSignalRSample.API.Model.RequestCommands 4 | { 5 | public class PaginatedRequestCommand : IRequestCommand 6 | { 7 | public PaginatedRequestCommand() { } 8 | public PaginatedRequestCommand(int page, int take) 9 | { 10 | 11 | Page = page; 12 | Take = take; 13 | } 14 | 15 | [Minimum(1)] 16 | public int Page { get; set; } 17 | 18 | [Minimum(1)] 19 | [Maximum(50)] 20 | public int Take { get; set; } 21 | } 22 | } -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.API.Model/RequestModels/ChatMessageRequestModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MultiLayerSignalRSample.API.Model.RequestModels 4 | { 5 | public class ChatMessageRequestModel 6 | { 7 | public string Message { get; set; } 8 | public DateTimeOffset ReceivedOn { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.API.Model/Validation/MaximumAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | using System.Globalization; 4 | 5 | namespace MultiLayerSignalRSample.API.Model.Validation 6 | { 7 | [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] 8 | public class MaximumAttribute : ValidationAttribute 9 | { 10 | private readonly int _maximumValue; 11 | 12 | public MaximumAttribute(int maximum) : 13 | base(errorMessage: "The {0} field value must be maximum {1}.") 14 | { 15 | _maximumValue = maximum; 16 | } 17 | 18 | public override string FormatErrorMessage(string name) 19 | { 20 | return string.Format(CultureInfo.CurrentCulture, ErrorMessageString, name, _maximumValue); 21 | } 22 | 23 | public override bool IsValid(object value) 24 | { 25 | int intValue; 26 | if (value != null && int.TryParse(value.ToString(), out intValue)) 27 | { 28 | return (intValue <= _maximumValue); 29 | } 30 | 31 | return false; 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.API.Model/Validation/MinimumAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | using System.Globalization; 4 | 5 | namespace MultiLayerSignalRSample.API.Model.Validation 6 | { 7 | [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] 8 | public class MinimumAttribute : ValidationAttribute 9 | { 10 | private readonly int _minimumValue; 11 | 12 | public MinimumAttribute(int minimum) : 13 | base(errorMessage: "The {0} field value must be minimum {1}.") 14 | { 15 | _minimumValue = minimum; 16 | } 17 | 18 | public override string FormatErrorMessage(string name) 19 | { 20 | return string.Format(CultureInfo.CurrentCulture, ErrorMessageString, name, _minimumValue); 21 | } 22 | 23 | public override bool IsValid(object value) 24 | { 25 | int intValue; 26 | if (value != null && int.TryParse(value.ToString(), out intValue)) 27 | { 28 | return (intValue >= _minimumValue); 29 | } 30 | 31 | return false; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.API.Model/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.API/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
    5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.API/Config/SignalRAutofac.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNet.SignalR; 2 | using Autofac; 3 | using MultiLayerSignalRSample.Domain.Entities.Core; 4 | using Autofac.Integration.SignalR; 5 | using MultiLayerSignalRSample.Domain.Services; 6 | using System.Reflection; 7 | 8 | namespace MultiLayerSignalRSample.API.Config 9 | { 10 | public static class SignalRAutofac 11 | { 12 | public static void Initialize() 13 | { 14 | GlobalHost.DependencyResolver = new AutofacDependencyResolver(RegisterServices(new ContainerBuilder())); 15 | } 16 | 17 | private static IContainer RegisterServices(ContainerBuilder builder) 18 | { 19 | builder.RegisterHubs(Assembly.GetExecutingAssembly()); 20 | 21 | builder.RegisterType().As(); 22 | builder.RegisterGeneric(typeof(EntityRepository<>)).As(typeof(IEntityRepository<>)); 23 | builder.RegisterType().As(); 24 | 25 | return builder.Build(); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.API/Config/WebApiAutofac.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Web.Http; 3 | using Autofac.Integration.WebApi; 4 | using Autofac; 5 | using MultiLayerSignalRSample.Domain.Entities.Core; 6 | using MultiLayerSignalRSample.Domain.Services; 7 | 8 | namespace MultiLayerSignalRSample.API.Config 9 | { 10 | public static class WebApiAutofac 11 | { 12 | public static void Initialize(HttpConfiguration config) 13 | { 14 | Initialize(config, RegisterServices(new ContainerBuilder())); 15 | } 16 | 17 | public static void Initialize(HttpConfiguration config, IContainer container) 18 | { 19 | config.DependencyResolver = new AutofacWebApiDependencyResolver(container); 20 | } 21 | 22 | private static IContainer RegisterServices(ContainerBuilder builder) 23 | { 24 | builder.RegisterApiControllers(Assembly.GetExecutingAssembly()); 25 | 26 | builder.RegisterType().As(); 27 | builder.RegisterGeneric(typeof(EntityRepository<>)).As(typeof(IEntityRepository<>)); 28 | builder.RegisterType().As(); 29 | 30 | return builder.Build(); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.API/Config/WebApiConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using System.Net.Http.Formatting; 3 | using System.Web.Http; 4 | using System.Web.Http.ModelBinding; 5 | using System.Web.Http.Validation; 6 | using System.Web.Http.Validation.Providers; 7 | using MultiLayerSignalRSample.API.Formatting; 8 | 9 | namespace MultiLayerSignalRSample.API.Config 10 | { 11 | public static class WebApiConfig 12 | { 13 | public static void Configure(HttpConfiguration config) 14 | { 15 | // If ExcludeMatchOnTypeOnly is true then we don't match on type only which means 16 | // that we return null if we can't match on anything in the request. This is useful 17 | // for generating 406 (Not Acceptable) status codes. 18 | config.Services.Replace(typeof(IContentNegotiator), 19 | new DefaultContentNegotiator(excludeMatchOnTypeOnly: true)); 20 | 21 | // Remove all the validation providers 22 | // except for DataAnnotationsModelValidatorProvider 23 | config.Services.RemoveAll(typeof(ModelValidatorProvider), 24 | validator => !(validator is DataAnnotationsModelValidatorProvider)); 25 | } 26 | 27 | private static void ConfigureFormatters(MediaTypeFormatterCollection formatters) 28 | { 29 | // Remove unnecessary formatters 30 | MediaTypeFormatter jqueryFormatter = formatters.FirstOrDefault(x => x.GetType() == typeof(JQueryMvcFormUrlEncodedFormatter)); 31 | formatters.Remove(formatters.XmlFormatter); 32 | formatters.Remove(formatters.FormUrlEncodedFormatter); 33 | formatters.Remove(jqueryFormatter); 34 | 35 | // Suppressing the IRequiredMemberSelector for all formatters 36 | foreach (var formatter in formatters) 37 | { 38 | formatter.RequiredMemberSelector = new SuppressedRequiredMemberSelector(); 39 | } 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.API/Config/WebApiRouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Http; 2 | 3 | namespace MultiLayerSignalRSample.API.Config 4 | { 5 | public static class WebApiRouteConfig 6 | { 7 | public static void RegisterRoutes(HttpConfiguration config) 8 | { 9 | HttpRouteCollection routes = config.Routes; 10 | 11 | routes.MapHttpRoute( 12 | "DefaultHttpRoute", 13 | "api/{controller}/{id}", 14 | defaults: new { id = RouteParameter.Optional }); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.API/Controllers/ChatMessagesController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using MultiLayerSignalRSample.API.Controllers.Core; 7 | using MultiLayerSignalRSample.API.Hubs; 8 | using MultiLayerSignalRSample.Domain.Entities; 9 | using MultiLayerSignalRSample.Domain.Entities.Core; 10 | 11 | namespace MultiLayerSignalRSample.API.Controllers 12 | { 13 | public class ChatMessagesController : HubController 14 | { 15 | private readonly IEntityRepository _chatMessageRepository; 16 | 17 | public ChatMessagesController(IEntityRepository chatMessageRepository) 18 | { 19 | _chatMessageRepository = chatMessageRepository; 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.API/Controllers/Core/HubController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.AspNet.SignalR; 3 | 4 | namespace MultiLayerSignalRSample.API.Controllers.Core 5 | { 6 | public abstract class HubController : HubControllerBase 7 | { 8 | private readonly string _hubName; 9 | 10 | protected HubController(string hubName) 11 | { 12 | if (hubName == null) 13 | { 14 | throw new ArgumentNullException("hubName"); 15 | } 16 | _hubName = hubName; 17 | } 18 | 19 | protected override IHubContext HubContext 20 | { 21 | get 22 | { 23 | return ConnectionManager.GetHubContext(_hubName); 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.API/Controllers/Core/HubControllerBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Web.Http; 7 | using Microsoft.AspNet.SignalR; 8 | using Microsoft.AspNet.SignalR.Hubs; 9 | using Microsoft.AspNet.SignalR.Infrastructure; 10 | 11 | namespace MultiLayerSignalRSample.API.Controllers.Core 12 | { 13 | public abstract class HubControllerBase : ApiController 14 | { 15 | private IConnectionManager _connectionManager; 16 | 17 | protected HubControllerBase() 18 | { 19 | } 20 | 21 | public IHubConnectionContext Clients 22 | { 23 | get 24 | { 25 | if (HubContext == null) 26 | { 27 | throw new InvalidOperationException(string.Format("No hub context could be found for the HubController of type '{0}'.", GetType().Name)); 28 | } 29 | return HubContext.Clients; 30 | } 31 | } 32 | 33 | public IGroupManager Groups 34 | { 35 | get 36 | { 37 | if (HubContext == null) 38 | { 39 | throw new InvalidOperationException(string.Format("No hub context could be found for the HubController of type '{0}'.", GetType().Name)); 40 | } 41 | return HubContext.Groups; 42 | } 43 | } 44 | 45 | protected abstract IHubContext HubContext 46 | { 47 | get; 48 | } 49 | 50 | protected IConnectionManager ConnectionManager 51 | { 52 | get 53 | { 54 | if (_connectionManager == null) 55 | { 56 | _connectionManager = ResolveConnectionManager(); 57 | } 58 | return _connectionManager; 59 | } 60 | } 61 | 62 | private IConnectionManager ResolveConnectionManager() 63 | { 64 | if (Configuration != null) 65 | { 66 | IConnectionManager connectionManager = Configuration.DependencyResolver.GetService(typeof(IConnectionManager)) as IConnectionManager; 67 | if (connectionManager != null) 68 | { 69 | return connectionManager; 70 | } 71 | } 72 | 73 | // If connection manager cannot be resolved by DependencyResolver, use the default connection manager instead. 74 | return GlobalHost.ConnectionManager; 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.API/Controllers/Core/HubControllerOfTHub.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNet.SignalR; 2 | using Microsoft.AspNet.SignalR.Hubs; 3 | 4 | namespace MultiLayerSignalRSample.API.Controllers.Core 5 | { 6 | public abstract class HubController : HubControllerBase where THub : IHub 7 | { 8 | protected override IHubContext HubContext 9 | { 10 | get 11 | { 12 | return ConnectionManager.GetHubContext(); 13 | } 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.API/Formatting/SuppressedRequiredMemberSelector.cs: -------------------------------------------------------------------------------- 1 | using System.Net.Http.Formatting; 2 | using System.Reflection; 3 | 4 | namespace MultiLayerSignalRSample.API.Formatting 5 | { 6 | public class SuppressedRequiredMemberSelector : IRequiredMemberSelector 7 | { 8 | public bool IsRequiredMember(MemberInfo member) 9 | { 10 | return false; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.API/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("MultiLayerSignalRSample.API")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("MultiLayerSignalRSample.API")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("722a61cd-f7e7-4f68-8c8f-89309f3b54eb")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.API/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.Domain/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
    5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.Domain/Entities/ChatMessage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using MultiLayerSignalRSample.Domain.Entities.Core; 3 | 4 | namespace MultiLayerSignalRSample.Domain.Entities 5 | { 6 | public class ChatMessage : IEntity 7 | { 8 | public int Id { get; set; } 9 | public int SenderId { get; set; } 10 | public string Content { get; set; } 11 | public DateTimeOffset ReceivedOn { get; set; } 12 | 13 | public User Sender { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.Domain/Entities/Core/ChatEntitiesContext.cs: -------------------------------------------------------------------------------- 1 | using System.Data.Entity; 2 | 3 | namespace MultiLayerSignalRSample.Domain.Entities.Core 4 | { 5 | public class ChatEntitiesContext : EntitiesContextBase 6 | { 7 | public IDbSet ChatMessages { get; set; } 8 | public IDbSet PrivateChatMessages { get; set; } 9 | public IDbSet HubConnections { get; set; } 10 | 11 | public IDbSet Users { get; set; } 12 | public IDbSet Roles { get; set; } 13 | public IDbSet UserInRoles { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.Domain/Entities/Core/IEntitiesContext.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Data.Entity; 3 | using System.Threading; 4 | using System.Threading.Tasks; 5 | 6 | namespace MultiLayerSignalRSample.Domain.Entities.Core 7 | { 8 | public interface IEntitiesContext : IDisposable 9 | { 10 | IDbSet Set() where TEntity : class; 11 | void SetAsAdded(TEntity entity) where TEntity : class; 12 | void SetAsModified(TEntity entity) where TEntity : class; 13 | void SetAsDeleted(TEntity entity) where TEntity : class; 14 | int SaveChanges(); 15 | Task SaveChangesAsync(); 16 | Task SaveChangesAsync(CancellationToken cancellationToken); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.Domain/Entities/Core/IEntity.cs: -------------------------------------------------------------------------------- 1 | namespace MultiLayerSignalRSample.Domain.Entities.Core 2 | { 3 | public interface IEntity 4 | { 5 | TId Id { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.Domain/Entities/Core/IEntityRepository'1.cs: -------------------------------------------------------------------------------- 1 | namespace MultiLayerSignalRSample.Domain.Entities.Core 2 | { 3 | public interface IEntityRepository : IEntityRepository 4 | where TEntity : class, IEntity 5 | { 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.Domain/Entities/Core/IEntityRepository'2.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Linq.Expressions; 5 | using System.Threading.Tasks; 6 | using System.Threading; 7 | 8 | namespace MultiLayerSignalRSample.Domain.Entities.Core 9 | { 10 | public interface IEntityRepository : IRepository 11 | where TEntity : class, IEntity 12 | { 13 | Task> LoadAllAsync(); 14 | Task> LoadAllAsync(CancellationToken cancellationToken); 15 | 16 | IQueryable GetAllIncluding(params Expression>[] includeProperties); 17 | Task> LoadAllIncludingAsync(CancellationToken cancellationToken, params Expression>[] includeProperties); 18 | Task> LoadAllIncludingAsync(params Expression>[] includeProperties); 19 | 20 | Task> LoadByAsync(Expression> predicate); 21 | Task> LoadByAsync(Expression> predicate, CancellationToken cancellationToken); 22 | 23 | PaginatedList Paginate( 24 | int pageIndex, int pageSize, Expression> keySelector); 25 | 26 | PaginatedList Paginate( 27 | int pageIndex, int pageSize, Expression> keySelector, Expression> predicate, params Expression>[] includeProperties); 28 | 29 | PaginatedList PaginateDescending( 30 | int pageIndex, int pageSize, Expression> keySelector); 31 | 32 | PaginatedList PaginateDescending( 33 | int pageIndex, int pageSize, Expression> keySelector, Expression> predicate, params Expression>[] includeProperties); 34 | 35 | Task GetSingleAsync(TId id); 36 | Task GetSingleAsync(TId id, CancellationToken cancellationToken); 37 | 38 | void Add(TEntity entity); 39 | void AddGraph(TEntity entity); 40 | void Edit(TEntity entity); 41 | void Delete(TEntity entity); 42 | int Save(); 43 | Task SaveAsync(); 44 | Task SaveAsync(CancellationToken cancellationToken); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.Domain/Entities/Core/IRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Linq.Expressions; 4 | 5 | namespace MultiLayerSignalRSample.Domain.Entities.Core 6 | { 7 | public interface IRepository 8 | where TEntity : class, IEntity 9 | { 10 | IQueryable GetAll(); 11 | IQueryable FindBy(Expression> predicate); 12 | PaginatedList Paginate(int pageIndex, int pageSize); 13 | 14 | TEntity GetSingle(TId id); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.Domain/Entities/Extensions/QueryableExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using System.Linq; 3 | 4 | namespace MultiLayerSignalRSample.Domain.Entities 5 | { 6 | [EditorBrowsable(EditorBrowsableState.Never)] 7 | public static class QueryableExtensions 8 | { 9 | public static PaginatedList ToPaginatedList( 10 | this IQueryable query, int pageIndex, int pageSize) 11 | { 12 | int totalCount = query.Count(); 13 | IQueryable collection = query.Skip((pageIndex - 1) * pageSize).Take(pageSize); 14 | 15 | return new PaginatedList(collection, pageIndex, pageSize, totalCount); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.Domain/Entities/Extensions/RoleRepositoryExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using MultiLayerSignalRSample.Domain.Entities.Core; 3 | 4 | namespace MultiLayerSignalRSample.Domain.Entities 5 | { 6 | public static class RoleRepositoryExtensions 7 | { 8 | public static Role GetSingleByRoleName( 9 | this IEntityRepository roleRepository, string roleName) 10 | { 11 | return roleRepository.GetAll().FirstOrDefault(x => x.Name == roleName); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.Domain/Entities/Extensions/UserInRoleRepositoryExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using MultiLayerSignalRSample.Domain.Entities.Core; 3 | 4 | namespace MultiLayerSignalRSample.Domain.Entities 5 | { 6 | public static class UserInRoleRepositoryExtensions 7 | { 8 | public static bool IsUserInRole( 9 | this IEntityRepository userInRoleRepository, 10 | int userId, 11 | int roleId) 12 | { 13 | return userInRoleRepository.GetAll() 14 | .Any(x => x.UserId == userId && x.RoleId == roleId); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.Domain/Entities/Extensions/UserRepositoryExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using MultiLayerSignalRSample.Domain.Entities.Core; 3 | 4 | namespace MultiLayerSignalRSample.Domain.Entities 5 | { 6 | public static class UserRepositoryExtensions 7 | { 8 | public static User GetSingleByUsername( 9 | this IEntityRepository userRepository, string username) 10 | { 11 | return userRepository.GetAll().FirstOrDefault(x => x.Name == username); 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.Domain/Entities/HubConnection.cs: -------------------------------------------------------------------------------- 1 | using MultiLayerSignalRSample.Domain.Entities.Core; 2 | 3 | namespace MultiLayerSignalRSample.Domain.Entities 4 | { 5 | public class HubConnection : IEntity 6 | { 7 | public int Id { get; set; } 8 | public int UserId { get; set; } 9 | public string ConnectionId { get; set; } 10 | 11 | public User User { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.Domain/Entities/PaginatedList.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace MultiLayerSignalRSample.Domain.Entities 5 | { 6 | public class PaginatedList : List 7 | { 8 | public int PageIndex { get; private set; } 9 | public int PageSize { get; private set; } 10 | public int TotalCount { get; private set; } 11 | public int TotalPageCount { get; private set; } 12 | 13 | public bool HasPreviousPage 14 | { 15 | get 16 | { 17 | return (PageIndex > 1); 18 | } 19 | } 20 | 21 | public bool HasNextPage 22 | { 23 | get 24 | { 25 | return (PageIndex < TotalPageCount); 26 | } 27 | } 28 | 29 | public PaginatedList(IEnumerable source, 30 | int pageIndex, int pageSize, int totalCount) 31 | { 32 | AddRange(source); 33 | 34 | PageIndex = pageIndex; 35 | PageSize = pageSize; 36 | TotalCount = totalCount; 37 | TotalPageCount = (int)Math.Ceiling(totalCount / (double)pageSize); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.Domain/Entities/PrivateChatMessage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations.Schema; 3 | using MultiLayerSignalRSample.Domain.Entities.Core; 4 | 5 | namespace MultiLayerSignalRSample.Domain.Entities { 6 | 7 | public class PrivateChatMessage : IEntity 8 | { 9 | public int Id { get; set; } 10 | 11 | [ForeignKey("Sender")] 12 | public int SenderId { get; set; } 13 | 14 | [ForeignKey("Receiver")] 15 | public int ReceiverId { get; set; } 16 | 17 | public string Content { get; set; } 18 | public DateTimeOffset ReceivedOn { get; set; } 19 | 20 | public virtual User Sender { get; set; } 21 | public virtual User Receiver { get; set; } 22 | } 23 | } -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.Domain/Entities/Role.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.ComponentModel.DataAnnotations; 3 | using MultiLayerSignalRSample.Domain.Entities.Core; 4 | 5 | namespace MultiLayerSignalRSample.Domain.Entities 6 | { 7 | public class Role : IEntity 8 | { 9 | public int Id { get; set; } 10 | 11 | [Required] 12 | [StringLength(50)] 13 | public string Name { get; set; } 14 | 15 | public virtual ICollection UserInRoles { get; set; } 16 | 17 | public Role() 18 | { 19 | UserInRoles = new HashSet(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.Domain/Entities/User.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | using System.ComponentModel.DataAnnotations.Schema; 4 | using System.Collections.Generic; 5 | using MultiLayerSignalRSample.Domain.Entities.Core; 6 | 7 | namespace MultiLayerSignalRSample.Domain.Entities 8 | { 9 | public class User : IEntity 10 | { 11 | public int Id { get; set; } 12 | 13 | [Required] 14 | [StringLength(50)] 15 | public string Name { get; set; } 16 | 17 | [Required] 18 | [StringLength(320)] 19 | public string Email { get; set; } 20 | 21 | [Required] 22 | public string HashedPassword { get; set; } 23 | 24 | [Required] 25 | public string Salt { get; set; } 26 | 27 | public bool IsLocked { get; set; } 28 | public DateTimeOffset CreatedOn { get; set; } 29 | public DateTimeOffset LastUpdatedOn { get; set; } 30 | 31 | public virtual ICollection UserInRoles { get; set; } 32 | public virtual ICollection ChatMessages { get; set; } 33 | public virtual ICollection HubConnections { get; set; } 34 | 35 | [InverseProperty("Sender")] 36 | public virtual ICollection SenderPrivateChatMessages { get; set; } 37 | 38 | [InverseProperty("Receiver")] 39 | public virtual ICollection ReceiverPrivateChatMessages { get; set; } 40 | } 41 | } -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.Domain/Entities/UserInRole.cs: -------------------------------------------------------------------------------- 1 | using MultiLayerSignalRSample.Domain.Entities.Core; 2 | 3 | namespace MultiLayerSignalRSample.Domain.Entities 4 | { 5 | public class UserInRole : IEntity 6 | { 7 | public int Id { get; set; } 8 | public int UserId { get; set; } 9 | public int RoleId { get; set; } 10 | 11 | public User User { get; set; } 12 | public Role Role { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.Domain/Migrations/201304240655220_init.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | namespace MultiLayerSignalRSample.Domain.Migrations 3 | { 4 | using System.CodeDom.Compiler; 5 | using System.Data.Entity.Migrations; 6 | using System.Data.Entity.Migrations.Infrastructure; 7 | using System.Resources; 8 | 9 | [GeneratedCode("EntityFramework.Migrations", "6.0.0-alpha3-20222")] 10 | public sealed partial class init : IMigrationMetadata 11 | { 12 | private readonly ResourceManager Resources = new ResourceManager(typeof(init)); 13 | 14 | string IMigrationMetadata.Id 15 | { 16 | get { return "201304240655220_init"; } 17 | } 18 | 19 | string IMigrationMetadata.Source 20 | { 21 | get { return null; } 22 | } 23 | 24 | string IMigrationMetadata.Target 25 | { 26 | get { return Resources.GetString("Target"); } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.Domain/Migrations/201304240655220_init.cs: -------------------------------------------------------------------------------- 1 | namespace MultiLayerSignalRSample.Domain.Migrations 2 | { 3 | using System; 4 | using System.Data.Entity.Migrations; 5 | 6 | public partial class init : DbMigration 7 | { 8 | public override void Up() 9 | { 10 | CreateTable( 11 | "dbo.Users", 12 | c => new 13 | { 14 | Id = c.Int(nullable: false, identity: true), 15 | UserName = c.String(), 16 | }) 17 | .PrimaryKey(t => t.Id); 18 | 19 | CreateTable( 20 | "dbo.ChatMessages", 21 | c => new 22 | { 23 | Id = c.Int(nullable: false, identity: true), 24 | SenderId = c.Int(nullable: false), 25 | Content = c.String(), 26 | ReceivedOn = c.DateTimeOffset(nullable: false), 27 | }) 28 | .PrimaryKey(t => t.Id) 29 | .ForeignKey("dbo.Users", t => t.SenderId, cascadeDelete: true) 30 | .Index(t => t.SenderId); 31 | 32 | CreateTable( 33 | "dbo.PrivateChatMessages", 34 | c => new 35 | { 36 | Id = c.Int(nullable: false, identity: true), 37 | SenderId = c.Int(nullable: false), 38 | ReceiverId = c.Int(nullable: false), 39 | Content = c.String(), 40 | ReceivedOn = c.DateTimeOffset(nullable: false), 41 | }) 42 | .PrimaryKey(t => t.Id) 43 | .ForeignKey("dbo.Users", t => t.SenderId, cascadeDelete: false) 44 | .ForeignKey("dbo.Users", t => t.ReceiverId, cascadeDelete: false) 45 | .Index(t => t.SenderId) 46 | .Index(t => t.ReceiverId); 47 | 48 | CreateTable( 49 | "dbo.HubConnections", 50 | c => new 51 | { 52 | Id = c.Int(nullable: false, identity: true), 53 | UserId = c.Int(nullable: false), 54 | ConnectionId = c.String(), 55 | }) 56 | .PrimaryKey(t => t.Id) 57 | .ForeignKey("dbo.Users", t => t.UserId, cascadeDelete: true) 58 | .Index(t => t.UserId); 59 | 60 | } 61 | 62 | public override void Down() 63 | { 64 | DropForeignKey("dbo.HubConnections", "UserId", "dbo.Users"); 65 | DropForeignKey("dbo.PrivateChatMessages", "ReceiverId", "dbo.Users"); 66 | DropForeignKey("dbo.PrivateChatMessages", "SenderId", "dbo.Users"); 67 | DropForeignKey("dbo.ChatMessages", "SenderId", "dbo.Users"); 68 | DropIndex("dbo.HubConnections", new[] { "UserId" }); 69 | DropIndex("dbo.PrivateChatMessages", new[] { "ReceiverId" }); 70 | DropIndex("dbo.PrivateChatMessages", new[] { "SenderId" }); 71 | DropIndex("dbo.ChatMessages", new[] { "SenderId" }); 72 | DropTable("dbo.HubConnections"); 73 | DropTable("dbo.PrivateChatMessages"); 74 | DropTable("dbo.ChatMessages"); 75 | DropTable("dbo.Users"); 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.Domain/Migrations/201304240710405_ExtendedUserManagement.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | namespace MultiLayerSignalRSample.Domain.Migrations 3 | { 4 | using System.CodeDom.Compiler; 5 | using System.Data.Entity.Migrations; 6 | using System.Data.Entity.Migrations.Infrastructure; 7 | using System.Resources; 8 | 9 | [GeneratedCode("EntityFramework.Migrations", "6.0.0-alpha3-20222")] 10 | public sealed partial class ExtendedUserManagement : IMigrationMetadata 11 | { 12 | private readonly ResourceManager Resources = new ResourceManager(typeof(ExtendedUserManagement)); 13 | 14 | string IMigrationMetadata.Id 15 | { 16 | get { return "201304240710405_ExtendedUserManagement"; } 17 | } 18 | 19 | string IMigrationMetadata.Source 20 | { 21 | get { return null; } 22 | } 23 | 24 | string IMigrationMetadata.Target 25 | { 26 | get { return Resources.GetString("Target"); } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.Domain/Migrations/201304240710405_ExtendedUserManagement.cs: -------------------------------------------------------------------------------- 1 | namespace MultiLayerSignalRSample.Domain.Migrations 2 | { 3 | using System; 4 | using System.Data.Entity.Migrations; 5 | 6 | public partial class ExtendedUserManagement : DbMigration 7 | { 8 | public override void Up() 9 | { 10 | CreateTable( 11 | "dbo.UserInRoles", 12 | c => new 13 | { 14 | Id = c.Int(nullable: false, identity: true), 15 | UserId = c.Int(nullable: false), 16 | RoleId = c.Int(nullable: false), 17 | }) 18 | .PrimaryKey(t => t.Id) 19 | .ForeignKey("dbo.Users", t => t.UserId, cascadeDelete: true) 20 | .ForeignKey("dbo.Roles", t => t.RoleId, cascadeDelete: true) 21 | .Index(t => t.UserId) 22 | .Index(t => t.RoleId); 23 | 24 | CreateTable( 25 | "dbo.Roles", 26 | c => new 27 | { 28 | Id = c.Int(nullable: false, identity: true), 29 | Name = c.String(nullable: false, maxLength: 50), 30 | }) 31 | .PrimaryKey(t => t.Id); 32 | 33 | AddColumn("dbo.Users", "Name", c => c.String(nullable: false, maxLength: 50)); 34 | AddColumn("dbo.Users", "Email", c => c.String(nullable: false, maxLength: 320)); 35 | AddColumn("dbo.Users", "HashedPassword", c => c.String(nullable: false)); 36 | AddColumn("dbo.Users", "Salt", c => c.String(nullable: false)); 37 | AddColumn("dbo.Users", "IsLocked", c => c.Boolean(nullable: false)); 38 | AddColumn("dbo.Users", "CreatedOn", c => c.DateTimeOffset(nullable: false)); 39 | AddColumn("dbo.Users", "LastUpdatedOn", c => c.DateTimeOffset(nullable: false)); 40 | DropColumn("dbo.Users", "UserName"); 41 | } 42 | 43 | public override void Down() 44 | { 45 | AddColumn("dbo.Users", "UserName", c => c.String()); 46 | DropForeignKey("dbo.UserInRoles", "RoleId", "dbo.Roles"); 47 | DropForeignKey("dbo.UserInRoles", "UserId", "dbo.Users"); 48 | DropIndex("dbo.UserInRoles", new[] { "RoleId" }); 49 | DropIndex("dbo.UserInRoles", new[] { "UserId" }); 50 | DropColumn("dbo.Users", "LastUpdatedOn"); 51 | DropColumn("dbo.Users", "CreatedOn"); 52 | DropColumn("dbo.Users", "IsLocked"); 53 | DropColumn("dbo.Users", "Salt"); 54 | DropColumn("dbo.Users", "HashedPassword"); 55 | DropColumn("dbo.Users", "Email"); 56 | DropColumn("dbo.Users", "Name"); 57 | DropTable("dbo.Roles"); 58 | DropTable("dbo.UserInRoles"); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.Domain/Migrations/Configuration.cs: -------------------------------------------------------------------------------- 1 | namespace MultiLayerSignalRSample.Domain.Migrations 2 | { 3 | using MultiLayerSignalRSample.Domain.Entities; 4 | using System; 5 | using System.Data.Entity; 6 | using System.Data.Entity.Migrations; 7 | using System.Linq; 8 | 9 | internal sealed class Configuration : DbMigrationsConfiguration 10 | { 11 | public Configuration() 12 | { 13 | AutomaticMigrationsEnabled = false; 14 | } 15 | 16 | protected override void Seed(MultiLayerSignalRSample.Domain.Entities.Core.ChatEntitiesContext context) 17 | { 18 | context.Roles.AddOrUpdate( 19 | role => role.Id, 20 | new Role 21 | { 22 | Id = 1, 23 | Name = RoleConstants.CHAT_USER_ROLE_NAME 24 | }); 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.Domain/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("MultiLayerSignalRSample.Domain")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("MultiLayerSignalRSample.Domain")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("a973189a-cc87-4b98-b878-8fec403f08fc")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.Domain/RoleConstants.cs: -------------------------------------------------------------------------------- 1 | namespace MultiLayerSignalRSample.Domain 2 | { 3 | public static class RoleConstants 4 | { 5 | public const string CHAT_USER_ROLE_NAME = "ChatUser"; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.Domain/Services/IMembershipService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using MultiLayerSignalRSample.Domain.Entities; 3 | 4 | namespace MultiLayerSignalRSample.Domain.Services 5 | { 6 | public interface IMembershipService 7 | { 8 | ValidUserContext ValidateUser(string username, string password); 9 | 10 | OperationResult CreateUser( 11 | string username, string email, string password); 12 | 13 | OperationResult CreateUser( 14 | string username, string email, 15 | string password, string role); 16 | 17 | OperationResult CreateUser( 18 | string username, string email, 19 | string password, string[] roles); 20 | 21 | UserWithRoles UpdateUser( 22 | User user, string username, string email); 23 | 24 | bool ChangePassword( 25 | string username, string oldPassword, string newPassword); 26 | 27 | bool AddToRole(int userId, string role); 28 | bool AddToRole(string username, string role); 29 | bool RemoveFromRole(string username, string role); 30 | 31 | IEnumerable GetRoles(); 32 | Role GetRole(int id); 33 | Role GetRole(string name); 34 | 35 | PaginatedList GetUsers(int pageIndex, int pageSize); 36 | UserWithRoles GetUser(int id); 37 | UserWithRoles GetUser(string name); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.Domain/Services/OperationResult.cs: -------------------------------------------------------------------------------- 1 | namespace MultiLayerSignalRSample.Domain.Services 2 | { 3 | public class OperationResult 4 | { 5 | public OperationResult(bool isSuccess) 6 | { 7 | IsSuccess = isSuccess; 8 | } 9 | 10 | public bool IsSuccess { get; private set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.Domain/Services/OperationResultOfTEntity.cs: -------------------------------------------------------------------------------- 1 | namespace MultiLayerSignalRSample.Domain.Services 2 | { 3 | public class OperationResult : OperationResult 4 | { 5 | public OperationResult(bool isSuccess) 6 | : base(isSuccess) { } 7 | 8 | public TEntity Entity { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.Domain/Services/UserWithRoles.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using MultiLayerSignalRSample.Domain.Entities; 3 | 4 | namespace MultiLayerSignalRSample.Domain.Services 5 | { 6 | public class UserWithRoles 7 | { 8 | public User User { get; set; } 9 | public IEnumerable Roles { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.Domain/Services/ValidUserContext.cs: -------------------------------------------------------------------------------- 1 | using System.Security.Principal; 2 | 3 | namespace MultiLayerSignalRSample.Domain.Services 4 | { 5 | public class ValidUserContext 6 | { 7 | public IPrincipal Principal { get; set; } 8 | public UserWithRoles User { get; set; } 9 | 10 | public bool IsValid() 11 | { 12 | return Principal != null; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.Domain/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MultiLayerSignalRSample", "MultiLayerSignalRSample\MultiLayerSignalRSample.csproj", "{23A03327-08C7-4FA0-A468-03C174A4D380}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MultiLayerSignalRSample.API", "MultiLayerSignalRSample.API\MultiLayerSignalRSample.API.csproj", "{9F84C965-DA41-4DAD-BA16-193521D5745A}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MultiLayerSignalRSample.Domain", "MultiLayerSignalRSample.Domain\MultiLayerSignalRSample.Domain.csproj", "{45E79910-32C7-42CD-BD93-BF96619D7D3F}" 9 | EndProject 10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{0D5352C6-539C-446A-B80E-5C7B67030C96}" 11 | ProjectSection(SolutionItems) = preProject 12 | .nuget\NuGet.Config = .nuget\NuGet.Config 13 | .nuget\NuGet.exe = .nuget\NuGet.exe 14 | .nuget\NuGet.targets = .nuget\NuGet.targets 15 | EndProjectSection 16 | EndProject 17 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MultiLayerSignalRSample.API.Model", "MultiLayerSignalRSample.API.Model\MultiLayerSignalRSample.API.Model.csproj", "{42DBF4E8-9C16-4DA2-8C9B-6E110F21CBA6}" 18 | EndProject 19 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".docs", ".docs", "{7207131B-4761-4335-AB07-8C3C0FC9857C}" 20 | ProjectSection(SolutionItems) = preProject 21 | ..\README.md = ..\README.md 22 | EndProjectSection 23 | EndProject 24 | Global 25 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 26 | Debug|Any CPU = Debug|Any CPU 27 | Release|Any CPU = Release|Any CPU 28 | EndGlobalSection 29 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 30 | {23A03327-08C7-4FA0-A468-03C174A4D380}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 31 | {23A03327-08C7-4FA0-A468-03C174A4D380}.Debug|Any CPU.Build.0 = Debug|Any CPU 32 | {23A03327-08C7-4FA0-A468-03C174A4D380}.Release|Any CPU.ActiveCfg = Release|Any CPU 33 | {23A03327-08C7-4FA0-A468-03C174A4D380}.Release|Any CPU.Build.0 = Release|Any CPU 34 | {9F84C965-DA41-4DAD-BA16-193521D5745A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 35 | {9F84C965-DA41-4DAD-BA16-193521D5745A}.Debug|Any CPU.Build.0 = Debug|Any CPU 36 | {9F84C965-DA41-4DAD-BA16-193521D5745A}.Release|Any CPU.ActiveCfg = Release|Any CPU 37 | {9F84C965-DA41-4DAD-BA16-193521D5745A}.Release|Any CPU.Build.0 = Release|Any CPU 38 | {45E79910-32C7-42CD-BD93-BF96619D7D3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 39 | {45E79910-32C7-42CD-BD93-BF96619D7D3F}.Debug|Any CPU.Build.0 = Debug|Any CPU 40 | {45E79910-32C7-42CD-BD93-BF96619D7D3F}.Release|Any CPU.ActiveCfg = Release|Any CPU 41 | {45E79910-32C7-42CD-BD93-BF96619D7D3F}.Release|Any CPU.Build.0 = Release|Any CPU 42 | {42DBF4E8-9C16-4DA2-8C9B-6E110F21CBA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 43 | {42DBF4E8-9C16-4DA2-8C9B-6E110F21CBA6}.Debug|Any CPU.Build.0 = Debug|Any CPU 44 | {42DBF4E8-9C16-4DA2-8C9B-6E110F21CBA6}.Release|Any CPU.ActiveCfg = Release|Any CPU 45 | {42DBF4E8-9C16-4DA2-8C9B-6E110F21CBA6}.Release|Any CPU.Build.0 = Release|Any CPU 46 | EndGlobalSection 47 | GlobalSection(SolutionProperties) = preSolution 48 | HideSolutionNode = FALSE 49 | EndGlobalSection 50 | EndGlobal 51 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample/App_Start/AutofacMvc.cs: -------------------------------------------------------------------------------- 1 | using Autofac; 2 | using Autofac.Integration.Mvc; 3 | using MultiLayerSignalRSample.Domain.Entities.Core; 4 | using MultiLayerSignalRSample.Domain.Services; 5 | using System.Web.Mvc; 6 | 7 | namespace MultiLayerSignalRSample 8 | { 9 | internal static class AutofacMvc 10 | { 11 | public static void Initialize() 12 | { 13 | var builder = new ContainerBuilder(); 14 | DependencyResolver.SetResolver(new AutofacDependencyResolver(RegisterServices(builder))); 15 | } 16 | 17 | private static IContainer RegisterServices(ContainerBuilder builder) 18 | { 19 | builder.RegisterControllers(typeof(MvcApplication).Assembly); 20 | 21 | builder.RegisterType().As(); 22 | builder.RegisterGeneric(typeof(EntityRepository<>)).As(typeof(IEntityRepository<>)); 23 | builder.RegisterType().As(); 24 | 25 | return builder.Build(); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample/App_Start/BundleConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Optimization; 2 | 3 | namespace MultiLayerSignalRSample 4 | { 5 | public static class BundleConfig 6 | { 7 | public static void RegisterBundles(BundleCollection bundles) 8 | { 9 | bundles.UseCdn = false; 10 | 11 | // .debug.js, -vsdoc.js and .intellisense.js files 12 | // are in BundleTable.Bundles.IgnoreList by default. 13 | // Clear out the list and add back the ones we want to ignore. 14 | // Don't add back .debug.js. 15 | bundles.IgnoreList.Clear(); 16 | bundles.IgnoreList.Ignore("*-vsdoc.js"); 17 | bundles.IgnoreList.Ignore("*intellisense.js"); 18 | 19 | // Modernizr goes separate since it loads first 20 | bundles.Add(new ScriptBundle("~/bundles/modernizr") 21 | .Include("~/Scripts/modernizr-{version}.js")); 22 | 23 | // jQuery 24 | bundles.Add(new ScriptBundle("~/bundles/jquery", 25 | "//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js") 26 | .Include("~/Scripts/jquery-{version}.js")); 27 | 28 | // 3rd Party JavaScript files 29 | bundles.Add(new ScriptBundle("~/bundles/jsextlibs") 30 | .Include( 31 | "~/Scripts/json2.js", // IE7 needs this 32 | 33 | // SignalR plugins 34 | "~/Scripts/jquery.signalR-1.1.0-beta1.js", 35 | 36 | // jQuery plugins 37 | "~/Scripts/TrafficCop.js", 38 | "~/Scripts/infuser.js", // depends on TrafficCop 39 | 40 | // Knockout and its plugins 41 | "~/Scripts/knockout-{version}.debug.js", 42 | "~/Scripts/koExternalTemplateEngine.js", 43 | 44 | // Other 3rd party libraries 45 | "~/Scripts/underscore.js", 46 | "~/Scripts/moment.js", 47 | "~/Scripts/sammy-{version}.js", 48 | "~/Scripts/lib/amplify.js", 49 | "~/Scripts/toastr.js" 50 | )); 51 | 52 | // All application JS files (except mocks) 53 | bundles.Add(new ScriptBundle("~/bundles/jsapplibs") 54 | .IncludeDirectory("~/Scripts/app/", "*.js", searchSubdirectories: false)); 55 | 56 | // All CSS files 57 | bundles.Add( 58 | new StyleBundle("~/Content/css") 59 | .Include("~/Content/ie10mobile.css") 60 | .Include("~/Content/bootstrap.css") 61 | .Include("~/Content/bootstrap-responsive.css") 62 | .Include("~/Content/font-awesome.css") 63 | .Include("~/Content/toastr.css") 64 | ); 65 | } 66 | } 67 | } -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Mvc; 3 | 4 | namespace MultiLayerSignalRSample { 5 | public class FilterConfig { 6 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) { 7 | filters.Add(new HandleErrorAttribute()); 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace MultiLayerSignalRSample { 9 | public class RouteConfig { 10 | public static void RegisterRoutes(RouteCollection routes) { 11 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 12 | 13 | routes.MapRoute( 14 | name: "Default", 15 | url: "{controller}/{action}/{id}", 16 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 17 | ); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample/Content/Site.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin-top: 15px; 3 | } 4 | 5 | legend { 6 | font-size: 1.2em; 7 | font-weight: bold; 8 | } 9 | 10 | textarea { 11 | min-height: 75px; 12 | } 13 | 14 | .editor-label { 15 | margin: 1em 0 0 0; 16 | } 17 | 18 | .editor-field { 19 | margin: 0.5em 0 0 0; 20 | } 21 | 22 | 23 | /* Styles for validation helpers 24 | -----------------------------------------------------------*/ 25 | .field-validation-error { 26 | color: #f00; 27 | } 28 | 29 | .field-validation-valid { 30 | display: none; 31 | } 32 | 33 | .input-validation-error { 34 | border: 1px solid #f00; 35 | background-color: #fee; 36 | } 37 | 38 | .validation-summary-errors { 39 | font-weight: bold; 40 | color: #f00; 41 | } 42 | 43 | .validation-summary-valid { 44 | display: none; 45 | } 46 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample/Content/font/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tugberkugurlu/SignalRSamples/7d66f037ee3d9e3f718ff56627b6eeedee32961f/MultiLayerSignalRSample/MultiLayerSignalRSample/Content/font/FontAwesome.otf -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample/Content/font/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tugberkugurlu/SignalRSamples/7d66f037ee3d9e3f718ff56627b6eeedee32961f/MultiLayerSignalRSample/MultiLayerSignalRSample/Content/font/fontawesome-webfont.eot -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample/Content/font/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tugberkugurlu/SignalRSamples/7d66f037ee3d9e3f718ff56627b6eeedee32961f/MultiLayerSignalRSample/MultiLayerSignalRSample/Content/font/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample/Content/font/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tugberkugurlu/SignalRSamples/7d66f037ee3d9e3f718ff56627b6eeedee32961f/MultiLayerSignalRSample/MultiLayerSignalRSample/Content/font/fontawesome-webfont.woff -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample/Content/ie10mobile.css: -------------------------------------------------------------------------------- 1 | @-webkit-viewport { 2 | width: device-width; 3 | } 4 | 5 | @-moz-viewport { 6 | width: device-width; 7 | } 8 | 9 | @-ms-viewport { 10 | width: device-width; 11 | } 12 | 13 | @-o-viewport { 14 | width: device-width; 15 | } 16 | 17 | @viewport { 18 | width: device-width; 19 | } -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample/Content/images/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tugberkugurlu/SignalRSamples/7d66f037ee3d9e3f718ff56627b6eeedee32961f/MultiLayerSignalRSample/MultiLayerSignalRSample/Content/images/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample/Content/images/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tugberkugurlu/SignalRSamples/7d66f037ee3d9e3f718ff56627b6eeedee32961f/MultiLayerSignalRSample/MultiLayerSignalRSample/Content/images/glyphicons-halflings.png -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample/Controllers/AccountController.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | using System.Web.Security; 3 | using MultiLayerSignalRSample.Domain; 4 | using MultiLayerSignalRSample.Models; 5 | using MultiLayerSignalRSample.Domain.Services; 6 | 7 | namespace MultiLayerSignalRSample.Controllers { 8 | 9 | public partial class AccountController : Controller 10 | { 11 | 12 | private readonly IMembershipService _membershipService; 13 | 14 | public AccountController(IMembershipService membershipService) 15 | { 16 | _membershipService = membershipService; 17 | } 18 | 19 | [HttpGet] 20 | public virtual ViewResult Login() 21 | { 22 | 23 | return View(); 24 | } 25 | 26 | [HttpPost] 27 | [ActionName("Login")] 28 | [ValidateAntiForgeryToken] 29 | public virtual ActionResult LoginPost(LoginModel loginModel) 30 | { 31 | 32 | if (ModelState.IsValid) 33 | { 34 | ValidUserContext validationContext = _membershipService.ValidateUser(loginModel.Name, loginModel.Password); 35 | if (validationContext.IsValid()) 36 | { 37 | FormsAuthentication.SetAuthCookie(loginModel.Name, true); 38 | return RedirectToAction("index", "Home"); 39 | } 40 | } 41 | 42 | return View(loginModel); 43 | } 44 | 45 | [HttpGet] 46 | public virtual ActionResult Register() 47 | { 48 | return View(); 49 | } 50 | 51 | [HttpPost] 52 | [ActionName("Register")] 53 | [ValidateAntiForgeryToken] 54 | public virtual ActionResult RegisterPost(RegisterModel registerModel) 55 | { 56 | if (ModelState.IsValid) 57 | { 58 | // Attempt to register the user 59 | OperationResult operationResult = _membershipService.CreateUser(registerModel.UserName, registerModel.Email, registerModel.Password, RoleConstants.CHAT_USER_ROLE_NAME); 60 | if(operationResult.IsSuccess) 61 | { 62 | FormsAuthentication.SetAuthCookie(registerModel.UserName, true); 63 | return RedirectToAction("Index", "Home"); 64 | } 65 | } 66 | 67 | ModelState.AddModelError("", "User registration failed and we don't know why. Suck it up!"); 68 | return View(registerModel); 69 | } 70 | 71 | [HttpPost] 72 | [ActionName("SignOut")] 73 | [ValidateAntiForgeryToken] 74 | public virtual ActionResult SignOutPost() 75 | { 76 | 77 | FormsAuthentication.SignOut(); 78 | return RedirectToAction("index", "Home"); 79 | } 80 | } 81 | } -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | 7 | namespace MultiLayerSignalRSample.Controllers { 8 | 9 | [Authorize] 10 | public partial class HomeController : Controller 11 | { 12 | 13 | public virtual ViewResult Index() 14 | { 15 | 16 | return View(); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="MultiLayerSignalRSample.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Http; 2 | using System.Web.Mvc; 3 | using System.Web.Optimization; 4 | using System.Web.Routing; 5 | using MultiLayerSignalRSample.API.Config; 6 | 7 | namespace MultiLayerSignalRSample { 8 | 9 | // Note: For instructions on enabling IIS6 or IIS7 classic mode, 10 | // visit http://go.microsoft.com/?LinkId=9394801 11 | 12 | public class MvcApplication : System.Web.HttpApplication { 13 | 14 | protected void Application_Start() { 15 | 16 | // Web API Config 17 | HttpConfiguration httpConfiguration = GlobalConfiguration.Configuration; 18 | WebApiAutofac.Initialize(httpConfiguration); 19 | WebApiRouteConfig.RegisterRoutes(httpConfiguration); 20 | WebApiConfig.Configure(httpConfiguration); 21 | 22 | // SignalR Config 23 | SignalRAutofac.Initialize(); 24 | RouteTable.Routes.MapHubs(); 25 | 26 | // MVC Config 27 | AutofacMvc.Initialize(); 28 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 29 | RouteConfig.RegisterRoutes(RouteTable.Routes); 30 | 31 | // Bundle Config 32 | //// Force optimization to be on or off, regardless of web.config setting 33 | //BundleTable.EnableOptimizations = false; 34 | BundleConfig.RegisterBundles(BundleTable.Bundles); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample/HomeController.generated.cs: -------------------------------------------------------------------------------- 1 | // 2 | // This file was generated by a T4 template. 3 | // Don't change it directly as your change would get overwritten. Instead, make changes 4 | // to the .tt file (i.e. the T4 template) and save it to regenerate this file. 5 | 6 | // Make sure the compiler doesn't complain about missing Xml comments 7 | #pragma warning disable 1591 8 | #region T4MVC 9 | 10 | using System; 11 | using System.Diagnostics; 12 | using System.CodeDom.Compiler; 13 | using System.Collections.Generic; 14 | using System.Linq; 15 | using System.Runtime.CompilerServices; 16 | using System.Web; 17 | using System.Web.Hosting; 18 | using System.Web.Mvc; 19 | using System.Web.Mvc.Ajax; 20 | using System.Web.Mvc.Html; 21 | using System.Web.Routing; 22 | using T4MVC; 23 | namespace MultiLayerSignalRSample.Controllers 24 | { 25 | public partial class HomeController 26 | { 27 | [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] 28 | public HomeController() { } 29 | 30 | [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] 31 | protected HomeController(Dummy d) { } 32 | 33 | [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] 34 | protected RedirectToRouteResult RedirectToAction(ActionResult result) 35 | { 36 | var callInfo = result.GetT4MVCResult(); 37 | return RedirectToRoute(callInfo.RouteValueDictionary); 38 | } 39 | 40 | [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] 41 | protected RedirectToRouteResult RedirectToActionPermanent(ActionResult result) 42 | { 43 | var callInfo = result.GetT4MVCResult(); 44 | return RedirectToRoutePermanent(callInfo.RouteValueDictionary); 45 | } 46 | 47 | 48 | [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] 49 | public HomeController Actions { get { return MVC.Home; } } 50 | [GeneratedCode("T4MVC", "2.0")] 51 | public readonly string Area = ""; 52 | [GeneratedCode("T4MVC", "2.0")] 53 | public readonly string Name = "Home"; 54 | [GeneratedCode("T4MVC", "2.0")] 55 | public const string NameConst = "Home"; 56 | 57 | static readonly ActionNamesClass s_actions = new ActionNamesClass(); 58 | [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] 59 | public ActionNamesClass ActionNames { get { return s_actions; } } 60 | [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] 61 | public class ActionNamesClass 62 | { 63 | public readonly string Index = "Index"; 64 | } 65 | 66 | [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] 67 | public class ActionNameConstants 68 | { 69 | public const string Index = "Index"; 70 | } 71 | 72 | 73 | static readonly ViewsClass s_views = new ViewsClass(); 74 | [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] 75 | public ViewsClass Views { get { return s_views; } } 76 | [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] 77 | public class ViewsClass 78 | { 79 | static readonly _ViewNamesClass s_ViewNames = new _ViewNamesClass(); 80 | public _ViewNamesClass ViewNames { get { return s_ViewNames; } } 81 | public class _ViewNamesClass 82 | { 83 | public readonly string Index = "Index"; 84 | } 85 | public readonly string Index = "~/Views/Home/Index.cshtml"; 86 | } 87 | } 88 | 89 | [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] 90 | public partial class T4MVC_HomeController : MultiLayerSignalRSample.Controllers.HomeController 91 | { 92 | public T4MVC_HomeController() : base(Dummy.Instance) { } 93 | 94 | partial void IndexOverride(T4MVC_System_Web_Mvc_ViewResult callInfo); 95 | 96 | public override System.Web.Mvc.ViewResult Index() 97 | { 98 | var callInfo = new T4MVC_System_Web_Mvc_ViewResult(Area, Name, ActionNames.Index); 99 | IndexOverride(callInfo); 100 | return callInfo; 101 | } 102 | 103 | } 104 | } 105 | 106 | #endregion T4MVC 107 | #pragma warning restore 1591 108 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample/Infrastructure/SafeCollection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace ConnectionMappingSample.Infrastructure { 7 | public class SafeCollection { 8 | } 9 | } -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample/Models/LoginModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace MultiLayerSignalRSample.Models { 4 | 5 | public class LoginModel { 6 | 7 | [Required] 8 | public string Name { get; set; } 9 | 10 | [Required] 11 | public string Password { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample/Models/RegisterModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace MultiLayerSignalRSample.Models 4 | { 5 | public class RegisterModel 6 | { 7 | [Required] 8 | [Display(Name = "User name")] 9 | public string UserName { get; set; } 10 | 11 | [Required] 12 | [EmailAddress] 13 | public string Email { get; set; } 14 | 15 | [Required] 16 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] 17 | [DataType(DataType.Password)] 18 | [Display(Name = "Password")] 19 | public string Password { get; set; } 20 | 21 | [DataType(DataType.Password)] 22 | [Display(Name = "Confirm password")] 23 | [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] 24 | public string ConfirmPassword { get; set; } 25 | } 26 | } -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ConnectionMappingSample")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ConnectionMappingSample")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("57be3a18-b27f-4b93-9bd2-ac2b9d8230b5")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample/Properties/PublishProfiles/Default Settings (2).pubxml: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | MSDeploy 9 | Release 10 | Any CPU 11 | http://signalr-webinar.cloudapp.net/ 12 | False 13 | https://signalr-webinar.cloudapp.net:8173/msdeploy.axd 14 | ChatSample 15 | 16 | True 17 | WMSVC 18 | True 19 | SIGNALR-WEB2\signalruser 20 | <_SavePWD>True 21 | 22 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample/Properties/PublishProfiles/Default Settings.pubxml: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | MSDeploy 9 | Release 10 | Any CPU 11 | http://SIGNALR-WEB1:80/ 12 | False 13 | https://signalr-webinar.cloudapp.net:8172/msdeploy.axd 14 | ChatSample 15 | 16 | True 17 | WMSVC 18 | True 19 | SIGNALR-WEB1\signalruser 20 | <_SavePWD>True 21 | 22 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample/Scripts/MIT-LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright 2011 appendTo LLC. (http://appendto.com/team) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample/Scripts/README.txt: -------------------------------------------------------------------------------- 1 | AmplifyJS 1.1.0 2 | http://amplifyjs.com 3 | Developed & Maintained by http://appendto.com 4 | 5 | Thank you for downloading AmplifyJS 1.1.0! This folder contains the full distribution of 6 | the AmplifyJS library including source and minified versions. 7 | 8 | [Licensing] 9 | AmplifyJS is dual licensed under either the MIT or GPL licenses. Both licenses have been included 10 | in the AmplifyJS download (and should be in the same folder as this file). View MIT-LICENSE.txt or 11 | GPL-LICENSE.txt for further details. Additional licensing questions may be directed to 12 | http://appendto.com or contact@appendto.com. 13 | 14 | [Including AmplifyJS In Your Project] 15 | - To include all AmplifyJS components : Copy amplify.min.js into the appropriate location such as 16 | /js/ and reference it via a 46 | } 47 | 48 |

    Chat, Chat, Chat...

    49 | 50 |
    51 | Hello @User.Identity.Name! Start chating... 52 |
    53 | 54 |
    55 | You are in a private chat with @@! Exit from private chat? 56 |
    57 | 58 |
    59 | 70 |
    71 |
      72 |
    • 73 | 74 |
    • 75 |
    76 |
    77 |
    -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = null; 3 | } 4 | 5 | 6 | 7 | 8 | 9 | Error 10 | 11 | 12 |

    13 | Sorry, an error occurred while processing your request. 14 |

    15 | 16 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | @ViewBag.Title 7 | @Styles.Render("~/Content/css") 8 | @RenderSection("head", required: false) 9 | 10 | 11 |
    12 |
    13 |
    14 | @if (User.Identity.IsAuthenticated) { 15 |
    16 | @using (Html.BeginForm("signout", "account")) { 17 | @Html.AntiForgeryToken() 18 | 19 | } 20 |
    21 | } 22 | @RenderBody() 23 |
    24 |
    25 |
    26 | @* When bundling, load in this sequence: 27 | 1) shivs and jQuery 28 | 2) 3rd party libraries 29 | 3) require.js 30 | 4) your app libraries 31 | 5) main.js *@ 32 | @Scripts.Render( 33 | "~/bundles/jquery", 34 | "~/bundles/jsextlibs", 35 | "~/Scripts/require.js", 36 | "~/bundles/jsapplibs", 37 | "~/Scripts/app/boot/main.js" 38 | ) 39 | @RenderSection("scripts", required: false) 40 | 41 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample/Views/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 |
    7 |
    8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 40 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample/Web.Debug.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample/Web.Release.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/MultiLayerSignalRSample/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /MultiLayerSignalRSample/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tugberkugurlu/SignalRSamples/7d66f037ee3d9e3f718ff56627b6eeedee32961f/MultiLayerSignalRSample/README.md -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Simple and Multi-layer SignalR Chat Application 2 | 3 | This's a chat application built with SignalR and various other open source server and client side libraries + frameworks. See the below list for all the used techologies: 4 | 5 | - ASP.NET SignalR 6 | - ASP.NET Web API 7 | - ASP.NET MVC 4 8 | - Entity Framework 6 9 | 10 | ## Credits 11 | 12 | - Application structure is inspired by [John Papa's Single Page App pluralsight course](http://pluralsight.com/training/Courses/TableOfContents/spa). 13 | - Idea is smilar to [JabbR](https://jabbr.net) but this application is nowhere near the quality of JabbR. -------------------------------------------------------------------------------- /RedisScaleOutSample/.nuget/NuGet.Config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /RedisScaleOutSample/.nuget/NuGet.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tugberkugurlu/SignalRSamples/7d66f037ee3d9e3f718ff56627b6eeedee32961f/RedisScaleOutSample/.nuget/NuGet.exe -------------------------------------------------------------------------------- /RedisScaleOutSample/RedisScaleOutSample.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RedisScaleOutSample", "RedisScaleOutSample\RedisScaleOutSample.csproj", "{F9E85E26-8F0D-4ECA-9C8E-9C5493446A5B}" 5 | EndProject 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{8F5CBA74-77A5-4DB8-8CDB-5314AB423D28}" 7 | ProjectSection(SolutionItems) = preProject 8 | .nuget\NuGet.Config = .nuget\NuGet.Config 9 | .nuget\NuGet.exe = .nuget\NuGet.exe 10 | .nuget\NuGet.targets = .nuget\NuGet.targets 11 | EndProjectSection 12 | EndProject 13 | Global 14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 15 | Debug|Any CPU = Debug|Any CPU 16 | Release|Any CPU = Release|Any CPU 17 | EndGlobalSection 18 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 19 | {F9E85E26-8F0D-4ECA-9C8E-9C5493446A5B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 20 | {F9E85E26-8F0D-4ECA-9C8E-9C5493446A5B}.Debug|Any CPU.Build.0 = Debug|Any CPU 21 | {F9E85E26-8F0D-4ECA-9C8E-9C5493446A5B}.Release|Any CPU.ActiveCfg = Release|Any CPU 22 | {F9E85E26-8F0D-4ECA-9C8E-9C5493446A5B}.Release|Any CPU.Build.0 = Release|Any CPU 23 | EndGlobalSection 24 | GlobalSection(SolutionProperties) = preSolution 25 | HideSolutionNode = FALSE 26 | EndGlobalSection 27 | EndGlobal 28 | -------------------------------------------------------------------------------- /RedisScaleOutSample/RedisScaleOutSample/Hubs/ChatHub.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNet.SignalR; 2 | 3 | namespace RedisScaleOutSample.Hubs 4 | { 5 | public class ChatHub : Hub 6 | { 7 | public void Send(string message) 8 | { 9 | Clients.All.messageReceived(message); 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /RedisScaleOutSample/RedisScaleOutSample/Index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Chat Sample 5 | 6 | 7 |
    8 | 9 | 10 |
    11 |
      12 | 13 | 14 | 15 | 16 | 35 | 36 | -------------------------------------------------------------------------------- /RedisScaleOutSample/RedisScaleOutSample/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("RedisScaleOutSample")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("RedisScaleOutSample")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("617842cb-7e96-48b7-bfc1-ce681721a62f")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /RedisScaleOutSample/RedisScaleOutSample/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNet.SignalR; 2 | using Owin; 3 | 4 | namespace RedisScaleOutSample 5 | { 6 | public class Startup 7 | { 8 | public void Configuration(IAppBuilder app) 9 | { 10 | GlobalHost.DependencyResolver.UseRedis("localhost", 6379, string.Empty, "myApp"); 11 | app.MapHubs(); 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /RedisScaleOutSample/RedisScaleOutSample/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /RedisScaleOutSample/RedisScaleOutSample/Web.Release.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | -------------------------------------------------------------------------------- /RedisScaleOutSample/RedisScaleOutSample/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /RedisScaleOutSample/RedisScaleOutSample/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /RedisScaleOutSample/run.ps1: -------------------------------------------------------------------------------- 1 | function programfiles-dir { 2 | if (is64bit -eq $true) { 3 | (Get-Item "Env:ProgramFiles(x86)").Value 4 | } else { 5 | (Get-Item "Env:ProgramFiles").Value 6 | } 7 | } 8 | 9 | function is64bit() { 10 | return ([IntPtr]::Size -eq 8) 11 | } 12 | 13 | $executingPath = (Split-Path -parent $MyInvocation.MyCommand.Definition) 14 | $appPPath = (join-path $executingPath "RedisScaleOutSample") 15 | $iisExpress = "$(programfiles-dir)\IIS Express\iisexpress.exe" 16 | $args1 = "/path:$appPPath /port:9090 /clr:v4.0" 17 | $args2 = "/path:$appPPath /port:9091 /clr:v4.0" 18 | 19 | start-process $iisExpress $args1 -windowstyle Normal 20 | start-process $iisExpress $args2 -windowstyle Normal -------------------------------------------------------------------------------- /SignalRIoCScopeSample/.nuget/NuGet.Config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /SignalRIoCScopeSample/.nuget/NuGet.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tugberkugurlu/SignalRSamples/7d66f037ee3d9e3f718ff56627b6eeedee32961f/SignalRIoCScopeSample/.nuget/NuGet.exe -------------------------------------------------------------------------------- /SignalRIoCScopeSample/SignalRIoCScopeSample.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SignalRIoCScopeSample", "SignalRIoCScopeSample\SignalRIoCScopeSample.csproj", "{B98B31B2-93EB-4402-92F9-3A469E13515D}" 5 | EndProject 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{2D13FA58-4A10-4115-B4BA-48B224491CC9}" 7 | ProjectSection(SolutionItems) = preProject 8 | .nuget\NuGet.Config = .nuget\NuGet.Config 9 | .nuget\NuGet.exe = .nuget\NuGet.exe 10 | .nuget\NuGet.targets = .nuget\NuGet.targets 11 | EndProjectSection 12 | EndProject 13 | Global 14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 15 | Debug|Any CPU = Debug|Any CPU 16 | Release|Any CPU = Release|Any CPU 17 | EndGlobalSection 18 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 19 | {B98B31B2-93EB-4402-92F9-3A469E13515D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 20 | {B98B31B2-93EB-4402-92F9-3A469E13515D}.Debug|Any CPU.Build.0 = Debug|Any CPU 21 | {B98B31B2-93EB-4402-92F9-3A469E13515D}.Release|Any CPU.ActiveCfg = Release|Any CPU 22 | {B98B31B2-93EB-4402-92F9-3A469E13515D}.Release|Any CPU.Build.0 = Release|Any CPU 23 | EndGlobalSection 24 | GlobalSection(SolutionProperties) = preSolution 25 | HideSolutionNode = FALSE 26 | EndGlobalSection 27 | EndGlobal 28 | -------------------------------------------------------------------------------- /SignalRIoCScopeSample/SignalRIoCScopeSample/Bar.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace SignalRIoCScopeSample 4 | { 5 | public class Bar : IBar 6 | { 7 | private readonly IBroadcaster _broadcaster; 8 | 9 | public Bar(IBroadcaster broadcaster) 10 | { 11 | _broadcaster = broadcaster; 12 | } 13 | 14 | public DateTimeOffset Broadcast() 15 | { 16 | return _broadcaster.Broadcast(); 17 | } 18 | } 19 | 20 | public interface IBar 21 | { 22 | DateTimeOffset Broadcast(); 23 | } 24 | } -------------------------------------------------------------------------------- /SignalRIoCScopeSample/SignalRIoCScopeSample/Broadcaster.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | 4 | namespace SignalRIoCScopeSample 5 | { 6 | public class Broadcaster : IBroadcaster 7 | { 8 | private readonly DateTimeOffset _date; 9 | 10 | public Broadcaster() 11 | { 12 | Trace.TraceInformation("Constructing Broadcaster..."); 13 | _date = DateTimeOffset.Now; 14 | } 15 | 16 | public DateTimeOffset Broadcast() 17 | { 18 | return _date; 19 | } 20 | 21 | public void Dispose() 22 | { 23 | Trace.TraceInformation("Disposing Broadcaster..."); 24 | } 25 | } 26 | 27 | public interface IBroadcaster : IDisposable 28 | { 29 | DateTimeOffset Broadcast(); 30 | } 31 | } -------------------------------------------------------------------------------- /SignalRIoCScopeSample/SignalRIoCScopeSample/Foo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace SignalRIoCScopeSample 4 | { 5 | public class Foo : IFoo 6 | { 7 | private readonly IBroadcaster _broadcaster; 8 | 9 | public Foo(IBroadcaster broadcaster) 10 | { 11 | _broadcaster = broadcaster; 12 | } 13 | 14 | public DateTimeOffset Broadcast() 15 | { 16 | return _broadcaster.Broadcast(); 17 | } 18 | } 19 | 20 | public interface IFoo 21 | { 22 | DateTimeOffset Broadcast(); 23 | } 24 | } -------------------------------------------------------------------------------- /SignalRIoCScopeSample/SignalRIoCScopeSample/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="SignalRIoCScopeSample.Global" Language="C#" %> 2 | -------------------------------------------------------------------------------- /SignalRIoCScopeSample/SignalRIoCScopeSample/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | using System.Web.Routing; 4 | using Autofac; 5 | using Autofac.Integration.SignalR; 6 | using Microsoft.AspNet.SignalR; 7 | using Newtonsoft.Json; 8 | using Newtonsoft.Json.Serialization; 9 | 10 | namespace SignalRIoCScopeSample 11 | { 12 | public class Global : System.Web.HttpApplication 13 | { 14 | protected void Application_Start(object sender, EventArgs e) 15 | { 16 | RouteTable.Routes.MapHubs(); 17 | IContainer container = RegisterServices(new ContainerBuilder()); 18 | GlobalHost.DependencyResolver = new AutofacDependencyResolver(container); 19 | } 20 | 21 | private static IContainer RegisterServices(ContainerBuilder builder) 22 | { 23 | builder.RegisterHubs(Assembly.GetExecutingAssembly()); 24 | JsonSerializer serializer = JsonSerializer.Create(new JsonSerializerSettings 25 | { 26 | DateFormatHandling = DateFormatHandling.IsoDateFormat, 27 | ContractResolver = new CamelCasePropertyNamesContractResolver() 28 | }); 29 | 30 | // The hub will create a lifetime scope manually in its constructor to resolve the IFoo and IBar services. 31 | builder.RegisterType().As().InstancePerLifetimeScope(); 32 | builder.RegisterType().As().InstancePerLifetimeScope(); 33 | builder.RegisterType().As().InstancePerLifetimeScope(); 34 | 35 | builder.Register(c => serializer).As(); 36 | return builder.Build(); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /SignalRIoCScopeSample/SignalRIoCScopeSample/Index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | Ping 9 |
        10 | 11 | 12 | 13 | 14 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /SignalRIoCScopeSample/SignalRIoCScopeSample/PingHub.cs: -------------------------------------------------------------------------------- 1 | using Autofac; 2 | using Microsoft.AspNet.SignalR; 3 | 4 | namespace SignalRIoCScopeSample 5 | { 6 | public class PingHub : Hub 7 | { 8 | private readonly IBar _bar; 9 | private readonly IFoo _foo; 10 | private readonly ILifetimeScope _hubLifetimeScope; 11 | 12 | public PingHub(ILifetimeScope lifetimeScope) 13 | { 14 | // Create a lifetime scope for this hub instance. 15 | _hubLifetimeScope = lifetimeScope.BeginLifetimeScope(); 16 | 17 | // Resolve the dependencies from the hub lifetime scope (unfortunately, service locator style). 18 | _bar = _hubLifetimeScope.Resolve(); 19 | _foo = _hubLifetimeScope.Resolve(); 20 | } 21 | 22 | public void Ping() 23 | { 24 | Clients.All.pinged("Pinged for IBar: " + _bar.Broadcast().ToString("MM/dd/yyyy hh:mm:ss.fff tt")); 25 | Clients.All.pinged("Pinged for IFoo: " + _foo.Broadcast().ToString("MM/dd/yyyy hh:mm:ss.fff tt")); 26 | } 27 | 28 | protected override void Dispose(bool disposing) 29 | { 30 | // When SignalR disposes the hub clean up the lifetime scope. 31 | if (disposing && _hubLifetimeScope != null) 32 | { 33 | _hubLifetimeScope.Dispose(); 34 | } 35 | base.Dispose(disposing); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /SignalRIoCScopeSample/SignalRIoCScopeSample/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("SignalRIoCScopeSample")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SignalRIoCScopeSample")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("2e8406d8-ac11-4bf1-ae34-3263696454e0")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /SignalRIoCScopeSample/SignalRIoCScopeSample/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /SignalRIoCScopeSample/SignalRIoCScopeSample/Web.Release.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | -------------------------------------------------------------------------------- /SignalRIoCScopeSample/SignalRIoCScopeSample/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /SignalRIoCScopeSample/SignalRIoCScopeSample/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | --------------------------------------------------------------------------------