使用Visual Studio 2010从xsd文件生成.NET 4.0 c#类(实体)有哪些选项?
我最近与另一位开发人员进行了讨论,他向我声称JOIN(SQL)没用.这在技术上是正确的,但他补充说,使用连接比在代码(C#或Java)中创建多个请求和链接表效率低.
对于他来说,加入的是懒惰的人,他们不关心表现.这是真的?我们应该避免使用连接吗?
我想知道什么,为什么或何时更好地选择cshtml以及选择aspx技术的原因是什么,为什么或何时更好?这两种技术的目的是什么?
谢谢,
我知道这不是提出这个问题的最佳地点,但很难找到一个好的答案,我更愿意问经验丰富的专业人士.
发布申请必须支付多少费用:
这些公司保留的百分比是多少?
在SQL Server Management Studio中我想知道什么是SQLCMD模式?
我想开发一个小型的C#应用程序来控制中央供暖的各种组件.
首先,我希望能够从温度传感器中检索值.我不能成为第一个想要获得此类东西的C#开发人员.然后我会尝试控制恒温阀.
Microsoft或其他供应商提供GUI库,数学库,数据库访问库,......我只是在寻找家庭自动化库或类似的东西.您可以将我重定向到与主题相关的硬件组件或信息站点.
谢谢,
当我在.NET 4.0中使用Entity Framework 5.0.0时,我在运行时得到一个无法识别的元素'providers'异常.实际上,在.NET 4.0中,当我使用NuGet进行安装包时,它是实体框架的4.4.0版本.当我从资源管理器中检查文件的属性时,我可以看到:
这是我的配置文件
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --></configSections>
<connectionStrings>
<add name="xxx" connectionString="metadata=res://*/StreetMusicModel.csdl|res://*/StreetMusicModel.ssdl|res://*/StreetMusicModel.msl; provider=MySql.Data.MySqlClient;provider connection string=' server=xxx.net; user id=xxx; password=xxx; database=xxx'" providerName="System.Data.EntityClient" />
</connectionStrings>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v12.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity" />
</providers>
</entityFramework>
Run Code Online (Sandbox Code Playgroud)
我感觉Entity Framework 4.4.0无法识别标签.我可以删除或重命名该部分吗?当我删除该部分时,我得到另一个例外:底层提供程序在Open上失败.
可能重复:
使用包含多个变量的语句
我有几个一次性物品要管理.CA2000规则要求我在退出范围之前处置所有对象..Dispose()
如果我可以使用using子句,我不喜欢使用该方法.在我的具体方法中,我应该在使用中写许多:
using (Person person = new Person()) {
using (Adress address = new Address()) {
// my code
}
}
Run Code Online (Sandbox Code Playgroud)
是否有可能以另一种方式写这个:
using (Person person = new Person(); Adress address = new Address())
Run Code Online (Sandbox Code Playgroud) 您能否澄清一下Web API错误管理的最佳实践?实际上,我不知道将try catch用于我的Api请求是否是一个好习惯.
public Vb.Order PostOrderItem(Vb.Order order)
{
if (OAuth.isValid(Request.Headers.GetValues("Token").Single()) != true)
{
HttpResponseMessage httpResponseMessage = new HttpResponseMessage(HttpStatusCode.Unauthorized);
throw new HttpResponseException(httpResponseMessage);
}
if (!ModelState.IsValid)
{
HttpResponseMessage httpResponseMessage = new HttpResponseMessage(HttpStatusCode.BadRequest);
throw new HttpResponseException(httpResponseMessage);
}
try
{
return Vb.Document.Generate(order);
}
catch (Exception ex)
{
logger.Error(ex);
HttpResponseMessage httpResponseMessage = new HttpResponseMessage(HttpStatusCode.BadRequest);
httpResponseMessage.Content = new StringContent(ex.Message);
throw new HttpResponseException(httpResponseMessage);
}
}
Run Code Online (Sandbox Code Playgroud)
我有使用try catch到服务器端代码的感觉不是一个好习惯,因为我只是记录我的catch并重新抛出一个异常.
c# ×6
.net ×3
asp.net ×2
sql ×2
android ×1
asp.net-mvc ×1
automation ×1
idisposable ×1
ios ×1
java ×1
join ×1
oracle ×1
plsql ×1
razor ×1
sql-server ×1
ssms ×1
using ×1
views ×1
xsd ×1