使用代码第一种方法对模型属性的唯一约束?

时间:2015-04-25 17:48:27

标签: c# .net entity code-first

如果我上课

private static int palindrome(char[] ch, int i, int j) {
    // TODO Auto-generated method stub
    if (i == j)
        return 1;

    // Base Case 2: If there are only 2 characters and both are same
    if (ch[i] == ch[j] && i + 1 == j)
        return 2;

    // If the first and last characters match
    if (ch[i] == ch[j])
        return palindrome(ch, i + 1, j - 1) + 2;

    // If the first and last characters do not match
    return max(palindrome(ch, i, j - 1), palindrome(ch, i + 1, j));

}

如何使用代码优先方法在Name属性上设置唯一约束?

0 个答案:

没有答案