是否可以使用Twitter Bootstrap创建类似GMail/GoogleGroups的布局,以便布局始终适合视口(窗口高度),侧边栏和内容区域可单独滚动?
--------------------------------------------------------------------------
| |
| Fixed top navbar |
--------------------------------------------------------------------------
| | |
| Sidebar | Content area scrollable |
| scrollable |
| | |
| | |
| | |
| | |
|------------------------------------------------------------------------|
Run Code Online (Sandbox Code Playgroud) 使用PetaPoco,您可以进行事务管理,执行以下操作:
var newObject = new NewObject();
var newObjectId = 1;
using (var scope = db.GetTransaction())
{
newObject = db.SingleOrDefault<NewObject>("SELECT * FROM tblNewObject WHERE Id = @0", newObjectId);
scope.Complete();
}
Run Code Online (Sandbox Code Playgroud)
虽然这对于管理事务更新时的管理非常有用,但是对于控制事务的隔离级别来说,它有点缺乏类似于使用传统SQL连接的方式:
TransactionOptions transOptions = new TransactionOptions() { IsolationLevel = IsolationLevel.ReadUncommitted };
using (new TransactionScope(TransactionScopeOption.Required, transOptions))
{
//here be transactions
}
Run Code Online (Sandbox Code Playgroud)
在PetaPoco中,GetTransaction返回一个新的Transaction,使用该特定的构造函数调用BeginTransaction.在这种情况下,BeginTransaction使用.NET的IDbConnection.BeginTransaction() - 它具有提供事务隔离级别的重载.据我所知,PetaPoco没有提供任何方法来为该方法提供隔离级别.有谁知道是否有可能实际修改PetaPoco的隔离级别而不必深入挖掘源并添加一个需要隔离级别的重载构造函数?我很高兴这样做并提交拉取请求,但我想确保在我完成工作之前,我不会错过任何简单明了的事情.
我目前有一个ViewModel设置:
public class OurViewModel
{
public OurViewModel() { }
[Required]
public int LeadID { get; set; }
[Required]
public int Rate { get; set; }
[Required]
public bool DepositRequired { get; set; }
[RequiredIfOtherPropertyIsTrue("DepositRequired")]
public BankInfo { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
...在这种情况下,"RequiredIfOtherPropertyIsTrue"是一个验证器,它完全按照它所说的:检查另一个属性是否为真(在这种情况下,我们的布尔值表示是否需要存款),而BankInfo是另一个属性看起来像这样的模型:
public class BankInfo
{
public enum AccountTypeEnum
{
CHECKING,
SAVINGS
}
public BankAccountInfo() { }
[DisplayName("Account Number")]
[Required(ErrorMessage = "You must provide a valid bank account number")]
public String AccountNumber { get; set; }
[DisplayName("Bank Routing Number")]
[Required(ErrorMessage …Run Code Online (Sandbox Code Playgroud) 我想让用户从我的 AWS S3 存储桶下载视频。视频格式为MP4:
app.get("/download_video", function(req,res) {
filename = "s3.xxx.amazon.com/bucketname/folder/video_example.mp4";
// im stuck on what i can do here
});
Run Code Online (Sandbox Code Playgroud)
有很多关于如何使用nodejs在线下载图像和文本文件的示例,但我在视频上找不到任何内容。
javascript ×2
asp.net-mvc ×1
c# ×1
css ×1
express ×1
html ×1
node.js ×1
petapoco ×1
transactions ×1
validation ×1
viewmodel ×1