我正在尝试将表格中的标题之一对齐。我试过:
.header-align-right {
display: flex;
justify-content: flex-end;
}
Run Code Online (Sandbox Code Playgroud)
在一个类中并将其添加到mat-header-cell. 这使文本右对齐,但也为元素添加了奇怪的间距,使其与其余标题不对齐。在没有的情况下也尝试过,display:flex但是什么也没做。
<ng-container matColumnDef="Number">
<th mat-header-cell *matHeaderCellDef mat-sort-header class="header-align-right">Number</th>
<td mat-cell *matCellDef="let row" align="right">{{row.Number}}</td>
<td mat-footer-cell *matFooterCellDef></td>
</ng-conIainer>
Run Code Online (Sandbox Code Playgroud)
如您所见,我将单元格的内容对齐,并且我也想对齐标题。
我正在使用MVC5使用summernote编辑器构建表单.
剃刀代码:
<div class="form-group">
@Html.LabelFor(model => model.Content, htmlAttributes: new { @class = "control-label" })
@Html.EditorFor(model => model.Content, new { htmlAttributes = new { @class = "form-control post-content"} })
@Html.ValidationMessageFor(model => model.Content, "", new { @class = "text-danger" })
</div>
Run Code Online (Sandbox Code Playgroud)
JS:
$('#blog-form .post-content').summernote({
height: 400,
minHeight: 300,
codemirror: {
theme: 'default'
}
});
Run Code Online (Sandbox Code Playgroud)
通过上面的设置,编辑器控件呈现得很好.但是,一旦我离开编辑器,即onBlur,我在控制台中收到以下错误:
Uncaught TypeError: Cannot read property 'replace' of undefined
at $.validator.escapeCssMeta (jquery.validate.js:1014)
at $.validator.errorsFor (jquery.validate.js:995)
at $.validator.prepareElement (jquery.validate.js:679)
at $.validator.element (jquery.validate.js:466)
at $.validator.onfocusout (jquery.validate.js:289)
at HTMLDivElement.delegate (jquery.validate.js:411)
at …Run Code Online (Sandbox Code Playgroud) 考虑以下控制器:
public class SubmissionController : Controller
{
public SubmissionController()
{ }
public IActionResult Post()
{
RecurringJob.AddOrUpdate(() => InitiateSubmission(), Cron.Minutely);
return Ok("Periodic submission triggered");
}
}
Run Code Online (Sandbox Code Playgroud)
Hangfire是否提供抽象为RecurringJob类注入依赖项?我已经做过一些研究,唯一可用的抽象是IBackgroundJobClient,它没有安排定期工作的选项。
我需要验证该作业已在单元测试中添加。
假设实体Patient存在于上下文中,该实体已使用数据库优先方法生成,因此我无法修改数据库。
public class Patient
{
public string Id { get; set; }
public string Surname { get; set; }
public string Forename { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
我想按姓名过滤患者,例如名字或姓氏或全名。我目前有以下查询:
await query
.Where(p => p.Forename != null && p.Forename.ToLower().Contains(filter) ||
p.Surname != null && p.Surname.ToLower().Contains(filter))
.ToListAsync();
Run Code Online (Sandbox Code Playgroud)
这显然只单独检查名字/姓氏列。如果过滤器是全名,则不起作用。
我尝试在 where 子句中进行字符串插值,以针对名字和姓氏的组合应用 contains 过滤器,但它在 ef 核心中不受支持并在本地执行。由于数据库中有超过一百万的患者,因此在应用程序中本地执行查询不是一种选择,必须在数据库中完成(搜索需要一分钟以上)。
有没有办法解决这个问题?
我有以下几点MailService:
public class MailService : IMailService
{
private readonly ILogger<MailService> _logger;
private readonly SmtpClient _client;
public MailService(ILogger<MailService> logger, SmtpClient client)
{
_logger = logger;
_client = client;
}
public async Task Send(string to, string subject, string body)
{
var message = new MailMessage
{
Subject = subject,
Body = body,
IsBodyHtml = true,
From = new MailAddress("info@domain.com")
};
message.To.Add(to);
using (_client)
{
_logger.LogTrace($"Sending email from {message.From.Address} to {to}. Subject: {subject}");
await _client.SendMailAsync(message);
}
}
}
Run Code Online (Sandbox Code Playgroud)
我想使用实现工厂创建此服务,因为我将从配置中读取 smtp 设置并提供 …
我在我的项目中使用Angular 5和材料垫表。
在我的组件文件中,我使用observable从服务中检索数据并将其绑定到组件上的变量。Mat-table显示行,但不打印数据。我尝试了ngFor,它似乎可以工作。控制台中没有错误。有什么想法为什么表格不显示在数据中?
TS:
import { Component, OnInit, ChangeDetectorRef } from '@angular/core';
import { NotificationService } from './../../core/services/notification.service';
import { OperationConfiguration } from './../../core/models/operationConfiguration';
import { ProgressBarService } from '../../core/services/progress-bar.service';
import { OperationConfigurationService } from '../../core/services/operation-configuration.service';
@Component({
selector: 'app-operation-configuration-list',
templateUrl: './operation-configuration-list.component.html',
styleUrls: ['./operation-configuration-list.component.css']
})
export class OperationConfigurationListComponent implements OnInit {
operationConfigurations: OperationConfiguration[];
columnsToDisplay: ['id', 'columnName', 'hidden'];
constructor(private progressBarService: ProgressBarService,
private notificationService: NotificationService,
private configurationService: OperationConfigurationService) {
this.progressBarService.show();
}
ngOnInit() {
this.loadOperationConfigurations();
}
private loadOperationConfigurations(): void {
this.configurationService.getAll(null)
.subscribe(
results => …Run Code Online (Sandbox Code Playgroud) c# ×3
angular ×2
.net-core ×1
css ×1
ef-core-2.0 ×1
hangfire ×1
javascript ×1
jquery ×1
razor ×1