我正在获取执行最基本查询的映射异常.这是我的域类:
public class Project
{
public virtual string PK { get; set; }
public virtual string Id { get; set; }
public virtual string Name { get; set; }
public virtual string Description { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
和映射类:
public class ProjectMap :ClassMap<Project>
{
public ProjectMap()
{
Table("PROJECTS");
Id(x => x.PK, "PK");
Map(x => x.Id, "ID");
Map(x => x.Name, "NAME");
Map(x => x.Description, "DESCRIPTION");
}
}
Run Code Online (Sandbox Code Playgroud)
组态:
public ISessionFactory SessionFactory
{
return Fluently.Configure()
.Database(MsSqlCeConfiguration.Standard.ShowSql().ConnectionString(c => c.Is("data source=" + path)))
.Mappings(m …Run Code Online (Sandbox Code Playgroud) 我来自Visual studio和C#,并且是Android(和eclipse)的新手,因此对基本功能一无所知.我写了一个简短的应用程序并在模拟器下运行它.没问题.现在我做了一些改变,想要测试它们.在VS中,我会在进行代码更改之前停止应用程序调试运行,并在代码更改再次运行之后.
我在eclipse中找不到'stop'调试按钮.我做了更改后如何运行我的应用程序?
我有这个包含实体列表的XML:
<?xml version="1.0" encoding="utf-8" ?>
<Connections>
<Connection>
<ConnectionName>connName</ConnectionName>
<InterfaceName>Account Lookup</InterfaceName>
<RequestFolder>C:\Documents and Settings\user\Desktop\Requests</RequestFolder>
<ResponseFolder>C:\Documents and Settings\user\Desktop\Responses</ResponseFolder>
</Connection>
</Connections>
Run Code Online (Sandbox Code Playgroud)
我正在尝试根据其名称检索其中一个并从中构建一个对象.
var results = (from i in this.Elements("Connection")
where i.Element("ConnectionName").ToString() == stubConnectionName
select new {
interfaceName = ((string)i.Element("InterfaceName").Value),
requestFolder = ((string)i.Element("RequestFolder").Value),
responseFolder = ((string)i.Element("ResponseFolder").Value),
}).Single();
return new StubConnection(stubConnectionName, results.interfaceName, results.requestFolder, results.responseFolder);
Run Code Online (Sandbox Code Playgroud)
问题是结果是空的.我的查询有什么问题?
Yoav - 编辑更清晰
嗨,我需要在文本文件中找到6位数字字符串.我在C#工作.例:
text text text123365 text text text
Run Code Online (Sandbox Code Playgroud)
表达式必须跳过超过6的字符串:
text text text1233656 text text text
Run Code Online (Sandbox Code Playgroud)
上面的字符串不应该返回任何结果,因为数字字符串的长度是7.
我想出了这个表达式: [^0-9]([0-9]){6}[^0-9]
它完美地工作,除了在行的开头或结尾的字符串
123365text text text text text text
text text text text text text123365
Run Code Online (Sandbox Code Playgroud)
是否可以识别这些案例?