This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Runtime.CompilerServices; | |
using System.Threading.Tasks; | |
using Microsoft.AspNet.SignalR.Hubs; | |
namespace Microsoft.AspNet.SignalR | |
{ | |
public abstract class Hub : IHub, IUntrackedDisposable, IDisposable | |
{ | |
protected Hub(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.connection.hub.starting(function () { | |
console.log('Conexión iniciada..'); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace NotificationApp.Hubs | |
{ | |
using System.Threading.Tasks; | |
using Microsoft.AspNet.SignalR; | |
/// <summary> | |
/// Hub de notificaciones de la aplicación. | |
/// </summary> | |
public class NotificationHub : Hub | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Web.Mvc; | |
using System.Web.Routing; | |
namespace Internacionalization | |
{ | |
public class RouteConfig | |
{ | |
public static void RegisterRoutes(RouteCollection routes) | |
{ | |
routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public ActionResult SetLanguage(string language) | |
{ | |
RouteData.Values["culture"] = language; | |
return RedirectToAction("Index"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Globalization; | |
using System.Threading; | |
using System.Web.Mvc; | |
using Internacionalization.Infraestructure; | |
namespace Internacionalization.Controllers | |
{ | |
public abstract class BaseController : Controller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Internacionalization.Infraestructure | |
{ | |
public static class SupportedCulture | |
{ | |
public const string Spanish = "es"; | |
public const string English = "en"; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Internacionalization.Infraestructure | |
{ | |
public static class SupportedCulture | |
{ | |
public const string Spanish = "es"; | |
public const string English = "en"; | |
public const string Arabic = "ar"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static string GetCulture(IReadOnlyList<string> cultureDefinition) | |
{ | |
return cultureDefinition[0] == SupportedCulture.English | |
? SupportedCulture.English | |
: cultureDefinition[0] == SupportedCulture.Arabic | |
? SupportedCulture.Arabic | |
: SupportedCulture.Spanish; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
namespace SharedEntities | |
{ | |
public partial class User | |
{ | |
public string Name { get; set; } | |
} |