/// <summary> /// Generate a new project number in the database. /// NOTE - this saves current changes to the datasource and should be called before other changes. /// If the subsequent save to the database fails the project number will be unused and result in an orphan. /// </summary> /// <param name="context"></param> /// <param name="format"></param> /// <returns></returns> public static string GenerateProjectNumber(this PimsContext context, string format) { var projectNumber = context.GenerateProjectNumber(); return(projectNumber.Generate(format)); }