/// <summary> /// Check if exception was thown because of unique index constraint on specific property /// </summary> /// <typeparam name="T"></typeparam> /// <param name="exception"></param> /// <param name="property"></param> /// <returns></returns> public static bool IsDuplicateException <T>(Exception exception, Expression <Func <T, object> > property) { string fieldName = FieldDefinitions.GetFieldMappedName(property); return(IsDuplicateException(exception, fieldName)); }
public static string GetFieldMappedName <TDocument>(Expression <Func <TDocument, object> > field) { var defin = FieldDefinitions.CreateField <TDocument>(field); return(GetFieldMappedName <TDocument>(defin)); }