A
Arash_89
Guest
Hello,
I should return the following code but How can write these? because we can return one of these.
return obj.Name.GetHashCode();
and
return obj.Family.GetHashCode();
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace ConsoleApp2
{
class CustomerNameComparer : IEqualityComparer<Customer>
{
public bool Equals(Customer x, Customer y)
{
return (x.Name == y.Name) && (x.Family == y.Family);
}
public int GetHashCode([DisallowNull] Customer obj)
{
return obj.GetHashCode();
}
}
}
Continue reading...
I should return the following code but How can write these? because we can return one of these.
return obj.Name.GetHashCode();
and
return obj.Family.GetHashCode();
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace ConsoleApp2
{
class CustomerNameComparer : IEqualityComparer<Customer>
{
public bool Equals(Customer x, Customer y)
{
return (x.Name == y.Name) && (x.Family == y.Family);
}
public int GetHashCode([DisallowNull] Customer obj)
{
return obj.GetHashCode();
}
}
}
Continue reading...