public class VmWord
{
public int Id { get; set; }
public string Name { get; set; }
public string Localization { get; set; }
[NotMapped]
public Dictionary<string, string> Localizations
{
get { return JsonConvert.DeseriazeObject<Dictionary<string, string>>(Localization.ToList()); }
set { Localization = JsonConvert.SerializeObject(value); }
}
}
public class VmWord
{
public int Id { get; set; }
public string Name { get; set; }
public virtual List<string> Localizations { get; set; }
}
public class Localization
{
public int Id { get; set; }
public string Key { get; set; }
public string Value { get; set; }
public virtual VmWord VmWord { get; set; }
}
<connectionStrings>
<add name="DB1Connection" connectionString="data source=(local);initial catalog=myDB1;" />
<add name="DB2Connection1" connectionString="data source=(local);initial catalog=myDB2;" />
<add name="DB3Connection1" connectionString="data source=(local);initial catalog=myDB3;" />
</connectionStrings>
connectionStringName = "DB3Connection1";
public class MyDbContext : DbContext
{
public MyDbContext(string connectionStringName) : base(connectionStringName)
{ }
}
a = [1, 2, 4, 4, 2, 2, 1, 4]
length = len(a)
i = 0
max = a[i]
while (i < length):
if(a[i] > max):
max = a[i]
i += 1
counter = 0
i = 0
result = length
while (i < length):
if(max == a[i]):
counter = counter + 1
if(i == (length - 1) or a[i+1] != max):
if(counter < result):
result = counter
counter = 0
i += 1
print(result)
input()
А как можно преобразовать строку в Int и в итоге получить 9 в функции
var predicate = true;
var anyMethod = function() { ... }
if(predicate && anyMethod){ ... }
if(predicate && anyMethod != null){ ... }
bd.User.OrderBy(x => x.Id).ElementAt(5);
bd.User.OrderBy(x => x.Id).ToList().FindIndex(x => x.Name == "Vasya");
Select Login from Accounts WHERE ...
не может дать Вам скалярное значение. Нужно либо запрос другой писать, либо вызывать другой метод на command. if (item.HasAttribute("data-previewurl"))
{
list.Add(item.GetAttribute("data-previewurl"));
}
"mysite.ru/" + item.GetAttribute("data-previewurl")