我有一个类定义为:
public class Student
{
public string Id { get; set; }
public IDictionary<string, string> Attributes { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
基于我在此处发现的讨论:http://groups.google.com/group/ravendb/browse_thread/thread/88ea52620021ed6c?pli = 1
我可以很容易地存储一个实例:
//creation
using (var session = store.OpenSession())
{
//now the student:
var student = new Student();
student.Attributes = new Dictionary<string, string>();
student.Attributes["NIC"] = "studentsNICnumberGoesHere";
session.Store(student);
session.SaveChanges();
}
Run Code Online (Sandbox Code Playgroud)
但是,当我查询如下:
//Testing query on attribute
using (var session = store.OpenSession())
{
var result = from student in session.Query<Student>()
where
student.Attributes["NIC"] == "studentsNICnumberGoesHere"
select student;
var test …Run Code Online (Sandbox Code Playgroud) Azure让我头疼.
我从一个教程开始.发布了一个新的MVC 3项目.花了大约9分钟然后它在我的生产VM上工作正常.
然后我尝试发布一个我一直在研究的项目(MVC 3).它具有以下依赖项:
Service.dll
Domain.dll
Autofac.dll
当我使用模拟器进行调试时,它工作正常.
当我解压缩包并将其部署到另一台服务器时,它工作正常.
但是当我发布到Azure Production时,我得到以下内容:1:
42 :31 PM - 准备使用订阅ID的网站部署:...
1:42:31 PM - 正在连接...
1:42:35 PM - 验证存储帐号'...'....
1:42:38 PM - 上传包...
1:44:46 PM - 创建...
1:45:56 PM - 创建部署ID:....
1:45 :56 PM - 开始...
1:46:34 PM - 初始化...
1:46:34 PM - 角色的实例0网站处于未知状态
1:46:34 PM - 角色的实例1网站位于未知状态
1:47:06 PM - 角色的实例0网站正在创建虚拟机
1:47:06 PM - 角色的实例1网站正在创建虚拟机
1:47:37 PM - 角色的实例0网站是启动虚拟机
1:47:37 PM - 角色的实例1网站启动虚拟机
1:50:13 PM - 角色的实例0网站处于未知状态
1:50:13 PM - 角色的实例1处于未知状态
1:50:44 PM …
我正在使用MVVM,每个View都映射到具有约定的ViewModel.IE MyApp.Views.MainWindowView MyApp.ViewModels.MainWindowViewModel
有没有办法删除DataTemplate并在C#中执行?有某种循环?
<DataTemplate DataType="{x:Type vm:MainWindowViewModel}">
<vw:MainWindowView />
</DataTemplate>
Run Code Online (Sandbox Code Playgroud) 我在MEF2上找不到任何好的例子.
我想创建一个插件目录并使用目录编目来加载Imports.
我想要的是什么:
我可以用Castle Windsor吗?
我需要一些我之前创建的MSBuild文件的帮助.
我想要做的就是构建解决方案,在解决方案中发布项目,然后将文件复制到目录中
当我将Teamcity设置为.net 4 msbuild,msbuild 4.0工具和86我得到一个错误说明
错误MSB4067:元素
<ItemDefinitionGroup>下面的元素<Project>无法识别.
<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Run">
<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets"/>
<PropertyGroup>
<OutputFolder>$(OutputDir)</OutputFolder>
<DeploymentFolder>$(DeploymentDir)</DeploymentFolder>
<CompilationDebug />
<CustomErrorsMode />
<ContentEditorsEmail />
<AdministratorsEmail />
</PropertyGroup>
<Target Name="Run">
<CallTarget Targets="Compile" />
<CallTarget Targets="Publish" />
<CallTarget Targets="Deploy" />
</Target>
<Target Name="Clean">
<ItemGroup>
<BinFiles Include="bin\*.*" />
</ItemGroup>
<Delete Files="@(BinFiles)" />
</Target>
<Target Name="Compile" DependsOnTargets="Clean">
<MSBuild Projects="WebCanvas.ZakisCatering.Website.sln"
Properties="Configuration=Release"/>
</Target>
<Target Name="Publish">
<RemoveDir Directories="$(OutputFolder)" ContinueOnError="true" />
<MSBuild Projects="WebCanvas.ZakisCatering.Website\WebCanvas.ZakisCatering.Website.csproj"
Targets="ResolveReferences;_CopyWebApplication"
Properties="Configuration=Release;WebProjectOutputDir=$(OutputFolder);OutDir=$(WebProjectOutputDir)\" />
</Target>
<Target Name="Deploy">
<RemoveDir Directories="$(DeploymentFolder)" …Run Code Online (Sandbox Code Playgroud) 有谁知道如何使Backbone路由不区分大小写?
IE http:// localhost/Products http:// localhost/products
两者都触发产品路线
routes: {
"products": "products"
},
Run Code Online (Sandbox Code Playgroud)
根据mu太短的答案,这里是完整的路由器.谢谢你的帮助
MainRouter = Backbone.Router.extend({
routes: {
"": "home",
"products": "products"
},
initialize: function () {
Backbone.history.start({ pushState: true });
},
home: function () {
// just show the products!!
this.products();
},
products: function () {
// wire up the view.
var ps = new ProductsView({ el: '#products', collection: myCollection });
ps.render();
// fetch the collection!!
myCollection.fetch();
},
_routeToRegExp: function (route) {
route = route.replace(this.escapeRegExp, "\\$&")
.replace(this.namedParam, "([^\/]*)") …Run Code Online (Sandbox Code Playgroud) azure ×1
backbone.js ×1
c# ×1
datatemplate ×1
mef ×1
mef2 ×1
msbuild-4.0 ×1
mvvm ×1
ravendb ×1
teamcity ×1
wpf ×1