This file contains hidden or 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
| { | |
| "Name": "Platform Maintenance", | |
| "Message": "Please be patient, we'll be back shortly", | |
| "ValidationErrors": [] | |
| } |
This file contains hidden or 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
| <appSettings> | |
| <!-- Disables EF model validation to allow for zero downtime deploys)--> | |
| <add key="DatabaseInitializerForType Moneybox.Core.Data.MoneyBoxContext, Moneybox.Core" value="Disabled" xdt:Transform="Insert" /> | |
| </appSettings> |
This file contains hidden or 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 users = await _db.Users.Include(x => x.Payments).Where().ToListAsync(); | |
| foreach (var user in users) | |
| { | |
| foreach (var payment in user.Payments) | |
| { | |
| ... | |
| } | |
| } |
This file contains hidden or 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 users = await _db.Users.Where(...).ToListAsync(); | |
| foreach (var user in users) | |
| { | |
| foreach (var payment in user.Payments) | |
| { | |
| ... | |
| } | |
| } |
This file contains hidden or 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
| gulp.task('uncss', function () { | |
| return gulp.src([ | |
| 'assets/styles/main.css' | |
| ]) | |
| .pipe(uncss({ | |
| html: [ | |
| 'http://localhost:59994/', | |
| 'http://localhost:59994/another-url', | |
| ... | |
| ] |
This file contains hidden or 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
| protected override void ConfigureApplicationContainer(TinyIoCContainer container) | |
| { | |
| container.Register<IUserMapper, UserMapper>(); | |
| container.Register<IEmailer, Emailer>(); | |
| // Any other dependencies you require | |
| } |
This file contains hidden or 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
| protected override void ConfigureApplicationContainer(TinyIoCContainer container) | |
| { | |
| base.ConfigureApplicationContainer(container); | |
| container.Register<IEmailer, Emailer>(); | |
| // Any other dependencies you require | |
| } |
This file contains hidden or 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
| @{ | |
| Layout = "_WelcomeLayout"; | |
| } | |
| <p>Hi @Model.Name,</p> | |
| <p>Welcome to my website.</p> | |
| <p>Have a nose around and let me know what you think!</p> |
This file contains hidden or 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 dispatcher = new Mock<IEmailDispatcher>(); | |
| var mailer = new RazorMailer("templates", dispatcher.Object, "hello@sampleapp.com", "SampleApp"); | |
| var email = mailer.Create("joe@blogs.com", "WelcomePartial", "Welcome to our service", new WelcomeModel { Name = "Joe Blogs" }); | |
| mailer.Send(email); | |
| dispatcher.Verify(x => x.Send(It.IsAny<MailMessage>()), Times.Once); | |
| Assert.Contains("Joe Blogs", email.Body); |
This file contains hidden or 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 MailMessage Create<T>(string to, string emailTemplate, string subject, T model) | |
| { | |
| var key = _service.GetKey(emailTemplate); | |
| var body = _service.RunCompile(key, typeof(T), model); | |
| return CreateMailMessage(to, subject, body); | |
| } |
NewerOlder