我正在学习 Ionic 应用程序。我接触到了 Grid 的东西,但是,我一直坚持删除/修改行之间的空格(第 2 行和第 3 行),如下面的屏幕截图所示:
我的 HTML 中有以下代码:
<ion-content padding>
<ion-row>
<ion-label> I am good I do not want any space.</ion-label>
</ion-row>
<ion-row>
<div >
<div class="inner">
<ion-label *ngIf="!inverse" no-margin>1 USD = 67 INR</ion-label>
<ion-label *ngIf="inverse" no-margin>1 INR = {{(1/67) | number }} USD </ion-label>
</div>
<button (click)="inverse=!inverse" ion-button clear class="iconWidth" color="dark"> <ion-icon name="swap" class="rotate"></ion-icon></button>
</div>
</ion-row>
<ion-row>
<p>Can you help me to get rid of space between this row and above</p>
<ion-label> Thanks</ion-label>
</ion-row>
</ion-content> …Run Code Online (Sandbox Code Playgroud) 我正在研究现有的代码库(Asp.net web api).在那里我遇到了下面的课程,它让我想到在哪种情况下这将是有用的?到目前为止,我已经看到了代码库,它还没有在任何地方使用过.因为它继承了Exception Class,所以我认为可以使用通用的Exception类来代替创建这个新的类.有人可以阐明这一点,即我们何时需要这样的定制课程以及它如何有用?
**定义了这个的开发人员已经离开了.
public class HttpResponseException : Exception
{
private string _message;
public HttpResponseException() : base() { }
public HttpResponseException(string message) : base(message)
{
this._message = message;
}
public override string Message
{
get
{
return this._message;
}
}
}
Run Code Online (Sandbox Code Playgroud) 我需要模拟一个 while 循环只运行一次,但是我的设置使它运行无限次,因为我认为它总是返回 true。
我的设置:
var loginName = "12345";
cacheRepository.Setup(m => m.AddString(string.Format("{0}_{1}", Resources.ResetCodeCacheKey, randomCode), loginName)).Returns(true);
Run Code Online (Sandbox Code Playgroud)
while 循环方法:
while (_cacheRepository.AddString(string.Format("{0}_{1}", Resources.ResetCodeCacheKey, code), userLoginName))
{
//.........
}
Run Code Online (Sandbox Code Playgroud)
添加字符串实现:
public virtual bool AddString(string key, string value)
{
if (!ExistsKey(key))
{
Cache.AddString(key, value);
return true;
}
return false;
}
Run Code Online (Sandbox Code Playgroud)
如何设置我的方法只返回 true 一次?代码片段会有所帮助。感谢您对此进行调查。
从c#执行查询时抛出异常:
command.CommandText = "UPDATE dbo.GENTBLDOCUMENT SET fTitle = temp.Title FROM dbo.GENTBLDOCUMENT T INNER JOIN #TmpTable Temp ON " +
"(T.fDocumentId = Temp.DocumentId); DROP TABLE #TmpTable;" + Environment.NewLine + "GO ";
Run Code Online (Sandbox Code Playgroud)
错误:
'GO'附近的语法不正确.
但是,当我从文本可视化工具中复制并在ssms中运行时,它运行正常.同时,如果我删除以下代码块,它运行正常:
+ Environment.NewLine + "GO "
Run Code Online (Sandbox Code Playgroud)
感谢您查看这个.我在这里使用临时表来进行批量复制.
c# ×3
.net ×2
angular ×1
css ×1
html ×1
ionic2 ×1
moq ×1
sql-server ×1
unit-testing ×1
winforms ×1