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 class ViewBaseClass<TModel> : DefaultTemplateBase<TModel> | |
{ | |
private readonly ITranslationService _translationService; | |
private CultureInfo _culture; | |
public ViewBaseClass(ITranslationService translationService, IApplicationSettings applicationSettings) | |
{ | |
_translationService = translationService; | |
ApplicationSettings = applicationSettings; | |
} |
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
var mailMessage = new MailMessage(); | |
string eml = mailMessage.ToEml(); |
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.IO; | |
using System.Net.Mail; | |
using System.Reflection; | |
using System.Text; | |
namespace Infrastructure.MailMessageExtensions | |
{ | |
public static class MailMessageExtensions | |
{ | |
public static string ToEml(this MailMessage message) |
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
@(Html.Grid("basic") | |
.SetCaption("Basic Grid") | |
.AddColumn(new Column("CustomerId") | |
.SetLabel("Id")) | |
.AddColumn(new Column("Name")) | |
.AddColumn(new Column("Company")) | |
.AddColumn(new Column("EmailAddress")) | |
.AddColumn(new Column("Last Modified")) | |
.AddColumn(new Column("Telephone")) | |
.SetUrl("/Home/GridData/") |
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 JsonResult GridData(GridSettings gridSettings) | |
{ | |
... | |
} |
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
NinjectValidatorFactory ninjectValidatorFactory = new NinjectValidatorFactory(Kernel); | |
FluentValidationModelValidatorProvider | |
.Configure(x => x.ValidatorFactory = ninjectValidatorFactory); | |
DataAnnotationsModelValidatorProvider | |
.AddImplicitRequiredAttributeForValueTypes = false; |
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
AssemblyScanner.FindValidatorsInAssembly( Assembly.GetExecutingAssembly()) | |
.ForEach(match => kernel.Bind(match.InterfaceType).To(match.ValidatorType)); |
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 class User | |
{ | |
public int Id { get; set; } | |
public string Firstname { get; set; } | |
public string Lastname { get; set; } | |
public string Email { get; set; } | |
public DateTime DateOfBirth { get; set; } | |
} |
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
// Create factory for poco's and setup datasources | |
var pocoFactory = AutoPocoContainer.Configure(x => | |
{ | |
x.Conventions(c => c.UseDefaultConventions()); | |
x.AddFromAssemblyContainingType<User>(); | |
x.Include<User>() | |
.Setup(u => u.Email).Use<EmailAddressSource>() | |
.Setup(u => u.Firstname).Use<FirstNameSource>() | |
.Setup(u => u.Lastname).Use<LastNameSource>() | |
.Setup(u => u.DateOfBirth).Use<DateOfBirthSource>(); |
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 class ExampleSource : DatasourceBase<string> | |
{ | |
public override string Next(IGenerationContext context) | |
{ | |
throw new NotImplementedException(); | |
} | |
} |
OlderNewer