Unique things in C# -- new for me(left for implementation at work)
C# doesnt support multiple inheritance, inorder to achieve this we have to use interface.
for example
public class example:Icards,Icad,Iadmin
(shortcut keys for property prop and controller contr)
1. lambda (expression and statement) and func<T> delegate (have to research more and more)
func<T> -> it is a concept .. we can store function as variables
2. extention method
3.optional parameter
3. Infinite parameter and function
4.Attributes
5. events and invoke keywords.(events and action are some other concept)
assigning value to a object new technique
pubnli cint CompareTo(object obj)
{
Program ex2 = (Program)obj -- this technique
}
some new functions to try:
return employee1.id.CompareTo(employee2.id) -- employee1 and employee2 are object (i dont know if they only work after implementing IComparer Interface in a class.. one way to find out is by implementing in work)
another way of taking parameter
([AllowNull] officer x,[AllowNull] officer y)
can also use [DisallowNull]
another funtion
return exampleData.GetHashCode().Equals(other.exampleData.GetHashCode()) --exampleData is a string variable where as other is object parameter... generate hash of each and compares...
(i dont know if it only works after implementing Iequatable or IequalityComparer interface... need to find out)
Comments
Post a Comment