class A { public string Name {get;set;} } void SetNull(ref string v) => if (v == "") v = null; SetNull(ref a.Name);