<GridViewColumn Header="Первое поле" Width="150">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding FirstString}" TextAlignment="Center"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<TextBlock Text="{Binding FirstString}" TextAlignment="Center"/>
<TextBlock Text="{Binding FirstString}" TextAlignment="{Binging Aligment}"/>
public static OutputListData<DictionaryElement> GetElementsByUserList(HashSet<string> InputUserList, List<DictionaryElement> InputTargetList)
{
OutputListData<DictionaryElement> answer = new OutputListData<DictionaryElement>();
answer.Data = new List<DictionaryElement>();
answer.ErrorMessage = "";
answer.IsSucsess = true;
var counter = 0;
foreach (var curStr in InputUserList)
{
counter++;
bool IsFind = false;
foreach(var curEl in InputTargetList)
{
if (curEl.RussianWord.Contains(curStr))
{
answer.Data.Add(curEl);
IsFind = true;
break;
}
}
if (!IsFind)
{
answer.IsSucsess = false;
answer.ErrorMessage = "Ошибка в строке #" + counter + ". Обнаружен элемент пользовательского списка, которого нет в словаре.";
}
}
return answer;
}
}
public class EfContext : DbContext
{
public DbSet<SurveyData> SurveyDatas { get; set; }
public DbSet<SurveyValue> SurveyValues { get; set; }
public EfContext(
DbContextOptions options)
: base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<SurveyData>().HasMany(p => p.Values).WithOne();
modelBuilder.Entity<SurveyData>().HasKey(entity => entity.Id);
modelBuilder.Entity<SurveyValue>().HasKey(entity => entity.Id);
}
}