.net

My model contains, among other things, two properties that were added to the model class after its initial creation and migration. public sealed class SomeModel { ... other properties, which are fine. public int PropertyOne { get; set; } public int PropertyTwo { get; set; } } My most recent migration contains: public override void Up() { ... other table being created.

。净

除此之外,我的模型还包含在初始创建和迁移后添加到模型类中的两个属性。 public sealed class SomeModel { ... other properties, which are fine. public int PropertyOne { get; set; } public int PropertyTwo { get; set; } } 我最近的迁移包含: public override void Up() { ... other table being created. AddColumn("dbo.SomeModel", "PropertyOne", c => c.Int(nullable: false));

Lose EF Code First Migration when working on different TFS branches?

We are using TFS and have different branches for our Dev. in the branch A we made a migration to change a column size in the branch B we made a migration to add a new table. This branch doesn not know about the branch A modification !! both modification are merged to the main branch. When I do an update database, it does the 2 migration but at the end tells me there is pending changes.

在不同的TFS分支上工作时丢失EF代码首次迁移?

我们正在使用TFS并为我们的开发者提供不同的分支。 在分支A中,我们进行了迁移以更改列大小 在分支B中,我们进行了迁移以添加一个新表。 这个分支不知道分支A的修改! 两个修改都合并到主分支。 当我执行更新数据库时,它执行2次迁移,但最终告诉我有未决的更改。 如果我进行了Add-Migration,它会创建与第一次迁移相同的结果(在分支A中)。 无法更新数据库以匹配当前模型,因为有未决的更改并且自动迁移已禁用。

model updated with [Required] attributes

My model previously was without any DataNotations, but I recently changed that, applying [Required] for some properties. As this happen, my migration code start to throw an exception, like: Unable to apply pending changes because automatic migration is disabled. To enable automatic migration, ensure that DbMigrationsConfiguration.AutomaticMigrationsEnabled is set to true. I assume that some

模型用[必需的]属性更新

我的模型以前没有任何DataNotations,但我最近改变了这种情况,对某些属性应用了[Required]。 发生这种情况时,我的迁移代码开始引发异常,如: 无法应用未决更改,因为已禁用自动迁移。 要启用自动迁移,请确保DbMigrationsConfiguration.AutomaticMigrationsEnabled设置为true。 我假设有一些明确的迁移行为必须完成。 请澄清。 编辑 :AutomaticMigrationsEnabled = true不适合我,我很有趣如何使一些迁移脚本成为可

Entity framework model first timestamp

I am developing Entity Framework based app. I am using model-first approach. I would like to handle the concurrency issues. As written in many articles I am going to do it by turning the ConcurrencyMode to fixed on a field which is a timestamp. At the moment I am facing the problem - I cannot add field (column) of type timestamp. How can I do it in model? As written here: http://social.m

实体框架模型的第一个时间戳

我正在开发基于实体框架的应用程序。 我正在使用模型优先的方法。 我想处理并发问题。 正如许多文章中写到的,我将通过将并发模式固定在时间戳字段上来实现。 目前我面临的问题 - 我不能添加类型时间戳的字段(列)。 我如何在模型中做到这一点? 正如这里所写: HTTP://social.msdn.microsoft.com/Forums/is/adodotnetentityframework/thread/1ed8d1e4-9d78-4593-9b10-33e033837af8 我尝试过安装Entity Designer数

Running a .NET app in Linux in 2015

TL;DR : what are the options nowadays to run a VS2015 solution on Linux? I have a .NET application that runs fine in Windows and have received requests to port it to Linux. I have been trying very hard to understand what it meant today in 2015 but I am really confused with all the old posts pointing to Mono and the new posts talking about vNext (and still mention Mono). Also I have an okay ba

2015年在Linux中运行.NET应用程序

TL; DR:现在在Linux上运行VS2015解决方案有哪些选择? 我有一个在Windows中运行良好的.NET应用程序,并且已经收到将它移植到Linux的请求。 2015年我一直在努力去理解今天的意义,但我真的很困惑所有指向Mono的新帖子和讨论vNext的新帖子(并且仍然提到Mono)。 我也有一个好的背景与.NET,但我不知道很多关于Linux的一般... 我遵循最近的教程,并设法在Linux中编译和运行Hello World控制台应用程序。 这需要安装一些我不

Best Linux distribution for running Mono

I'm a .Net developer and would like to investigate building and running our framework on Mono. If the initial project is successful I will happily invest in an OS learning curve, but right now I want to focus on getting things up and running and seeing the code working. What would be the best distribution to start with, assuming that I know very little about Linux, but am an experienced d

运行Mono的最佳Linux发行版

我是一个.Net开发人员,并希望调查在Mono上构建和运行我们的框架。 如果最初的项目是成功的,我会很乐意投资于操作系统的学习曲线,但现在我想专注于开发和运行代码并运行代码。 假设我对Linux知之甚少,但是一位有经验的开发人员,那么最好的发行版是什么? 我可以期待如何快速(小时/天/周?)? 到目前为止的一些反馈 (谢谢你的回答,大家):决定在CentOS上,但这也是因为这符合我想要移植到Mono的.Net代码的特定实

Can I use Linux/Mono to deploy aspnet web application?

I have a C#/ASP.NET application which works on windows with IIS. But recently I'm tempted to switch to Linux/Mono. It comes up with some questions: Can I run my Visual Studio projects and source codes in Mono correctly? My clients use IIS for ASP.NET . Does my migration affect them? In other words does my Mono projects runs in IIS without any change or problem? Can I host Mono ASP.N

我可以使用Linux / Mono来部署aspnet web应用程序吗?

我有一个C#/ ASP.NET应用程序,它可以在Windows上使用IIS。 但最近我很想切换到Linux / Mono。 它提出了一些问题: 我可以在Mono中正确运行我的Visual Studio项目和源代码吗? 我的客户使用ASP.NET for ASP.NET。 我的迁移是否会影响他们? 换句话说,我的Mono项目在IIS中运行时没有任何变化或问题? 我可以在Apache中承载Mono ASP.NET Web项目吗? 我可以在Mono中使用ASP.NET Web窗体中的技能吗? 等待您的宝贵

Is .NET Execution Environment (DNX) similar to mono?

Here is the description of DNX: The .NET Execution Environment (DNX) is a software development kit (SDK) and runtime environment that has everything you need to build and run .NET applications for Windows, Mac and Linux. It provide a host process, CLR hosting logic and managed entry point discovery. DNX was built for running cross-platform ASP.NET Web applications, but it can run other types

.NET执行环境(DNX)与单声道类似吗?

以下是DNX的说明: .NET执行环境(DNX)是一个软件开发工具包(SDK)和运行时环境,拥有构建和运行Windows,Mac和Linux的.NET应用程序所需的一切。 它提供主机进程,CLR托管逻辑和管理入口点发现。 DNX是为运行跨平台ASP.NET Web应用程序而构建的,但它也可以运行其他类型的.NET应用程序,例如跨平台控制台应用程序。 DNX是否可以选择单声道? 如果不是,那么会有什么区别? DNX是否可以选择单声道? 如果不是,那么会

Entity Framework from .NET 3.5 with SQL CE 4.0

Is there a way to get the Entity Framework that ships with .NET 3.5 to work with SQL Compact 4.0? I have a project that relies on .NET 3.5, and I can't move to .NET 4.0 yet, so Entity Framework 4 isn't an option. My existing code base works with .NET 3.5/EF 1/SQLCE 3.5 SP2, but on multi-threaded machines I get crashes now and then. I'd like to move to SQL CE 4.0 to see if that re

来自.NET 3.5的实体框架与SQL CE 4.0

有没有办法让.NET 3.5附带的实体框架与SQL Compact 4.0协同工作? 我有一个依赖于.NET 3.5的项目,而且我现在还不能迁移到.NET 4.0,所以Entity Framework 4不是一个选项。 我现有的代码库适用于.NET 3.5 / EF 1 / SQLCE 3.5 SP2,但在多线程机器上,我现在碰到了崩溃。 我想迁移到SQL CE 4.0以查看是否可以解决这些问题。 在做了额外的研究之后,答案是否定的。 SQL CE 4.0只适用于EF 4。 尝试对我在此处描述的edmx文件

9] in .NET regular expressions

This question already has an answer here: d is less efficient than [0-9] 6 answers I think the answer is also in the linked reference: d matches any decimal digit. It is equivalent to the p{Nd} regular expression pattern, which includes the standard decimal digits 0-9 as well as the decimal digits of a number of other character sets . So d can match things like decimal digits in the Arab

9]在.NET正则表达式中

这个问题在这里已经有了答案: d效率低于[0-9] 6个答案 我想答案也在链接参考中: d匹配任何十进制数字。 它相当于 p {Nd}正则表达式,其中包含标准的十进制数字0-9 以及许多其他字符集的十进制数字 。 因此, d可以匹配阿拉伯字符集中的十进制数字,而不会与[0-9]匹配。