/// <summary> /// Maps DalSubject entity to Subject entity. /// </summary> /// <param name="subject"> DalSubject instance.</param> /// <returns> Subject instance.</returns> public static Subject ToSubject(this DalSubject subject) { return(new Subject() { Id = subject.Id, Name = subject.Name }); }
/// <summary> /// Adds new subject to data storage. /// </summary> /// <param name="subject"> Subject to add.</param> /// <exception> System.ArgumentNullException if subject is null.</exception> public void Create(DalSubject subject) => repository.Create(subject?.ToSubject());