24 lines
564 B
C#
24 lines
564 B
C#
using System;
|
|
using Students;
|
|
|
|
namespace Extension
|
|
{
|
|
static class MyExtensions
|
|
{
|
|
public static void Print(this DateTime dateTime)
|
|
{
|
|
Console.WriteLine($"{dateTime.Day} {dateTime.Month} {dateTime.Year}");
|
|
}
|
|
|
|
public static bool IsDayOfWeek(this DateTime dateTime, DayOfWeek dayOfWeek)
|
|
{
|
|
return dateTime.DayOfWeek == dayOfWeek;
|
|
}
|
|
|
|
public static string GetFullName(this Student student)
|
|
{
|
|
return student.LastName + " " + student.FirstName;
|
|
}
|
|
}
|
|
}
|